Project

General

Profile

Actions

Feature #4971

open

OsmoCC Socket Documentation

Added by foxrf about 3 years ago. Updated 5 months ago.

Status:
New
Priority:
Low
Assignee:
Target version:
-
Start date:
01/22/2021
Due date:
% Done:

0%

Spec Reference:

Description

It appears that the MNCC socket has been replaced with OSMOCC which does not appear to have ANY documentation around how you are actually supposed to configure call routing with this thing. More specially the osmo-cc-router package attempts to call a bash script "routing.sh" for which there is no sample or documentation going over the syntax. Please add full documentation on how this bash script is supposed to route calls and or provide a detailed example script.


Files

Screenshot from 2021-01-22 16-20-23.png View Screenshot from 2021-01-22 16-20-23.png 175 KB foxrf, 01/22/2021 10:27 PM
IMG_3821.jpg View IMG_3821.jpg 928 KB atmega, 02/12/2021 11:07 AM
cnetz.txt cnetz.txt 36.7 KB console output for cnetz using option -o mstamm, 03/04/2021 09:53 PM
osmo-cc-router.txt osmo-cc-router.txt 7.7 KB console output for cnetz using option -o mstamm, 03/04/2021 09:54 PM
Actions #1

Updated by laforge about 3 years ago

  • Assignee set to jolly
Actions #2

Updated by laforge about 3 years ago

I've assigned this to jolly, as he's really the only one (AFAICT) working on osmocom-analog.

As for OsmoCC, there had been an early "concept paper" that jolly shared among the Osmocom developers, but I'm not sure how accurate it still is, and whether he intended it to be publicly distributed.

Actions #3

Updated by atmega about 3 years ago

Hey, did you managed to do anyprogress? What OSMO-CC should connect to ?

Actions #4

Updated by atmega about 3 years ago

I am stuck at socket failed ;-(

Actions #5

Updated by foxrf about 3 years ago

On 2021-02-12 05:08, atmega [REDMINE] wrote:

Issue #4971 has been updated by atmega.

File IMG_3821.jpg added

I am stuck at socket failed ;-(

Actions #6

Updated by aldude999 about 3 years ago

It looks like the routing script needs to echo commands based on the calling number/called number on what to do on what call. Taking a look at call.c under the routing_receive_stdout() function seems to show a list of possible commands. I was able to get it to respond to my calls with the "call cannot be completed as dialed" response by placing the following in the routing.sh script:

#!/bin/sh
echo "call interface :"

Then set the permissions on the routing script to 775. I'll have to play with some of the endpoint software to see if it gets me any further. It looks like more complex scripts could be built by comparing the arguments osmo-cc-router sends the scripts, it looks like it sends the caller/called number as arguments.

Actions #7

Updated by aldude999 about 3 years ago

So after fiddling around with the software a bit more, I managed to get a call going through SIP, you have to compile osmo-cc-sip-endpoint, osmo-cc-router isn't actually needed at all. I set up an Asterisk server, but any SIP server should work. I made an account for the cell phone using it's phone number as the extension.

One thing I did notice was that if you tried to make a call from a sip client to your analog phone, something along the way drops the phone number you want to ring. Here's the command I ran to get the sip endpoint working:

osmo-cc-sip-endpoint -r [SIP_SERVER_IP] -l [OSMOCOM-ANALOG_IP] -A [PHONENUMBER] [SIP_PASSWORD] [DOMAIN/IP] --register [PHONENUMBER]@[DOMAIN/IP] --cc 'screen-called-in "" "[PHONENUMBER]"'

The screen-called-in replaces the weird null phone number into the actual phone you want to ring.

Hope this helps out a bit!

Actions #8

Updated by mstamm about 3 years ago

I am stuck at a somewhat similar problem. I'm trying to set up osmocom-analog using a LimeSDR and two C-Netz mobiles, and - eventually - I want to implement a SIP connection with a PBX. Using the command line above, I can successfully register osmo-cc-sip-endpoint against my SIP PBX, but I am unable to make or receive any calls, even within osmocom-analog itself.

Theoretically, osmocom-analog with the option -x should be able to connect calls from one mobile to another. Both mobiles register successfully, but any number I dial from either mobile always connects the mobile to the waiting/queue music. The call never connects. The numbers are correct, and both mobiles successfully register against osmocom-analog.

I also tried osmo-cc-router, with the adapted routing.sh above, but the result was the same.

I simply do not know where to look next - I'm attaching the console output for cnetz and for osmo-cc-router.

I believe before I can address the issue of connecting through SIP, I must find out why even osmocom-analog itself does not connect one mobile to another despite the presence of one OgK and two SpK channels.

Can anyone give me a hint as to where to look from the console output, or is there any other diagnostic I could run? This is one of the unnerving issues where theroetically, everything should work as designed, and actually, it does not.

Thank you in advance!

Actions #9

Updated by aldude999 about 3 years ago

mstamm wrote:

I am stuck at a somewhat similar problem. I'm trying to set up osmocom-analog using a LimeSDR and two C-Netz mobiles, and - eventually - I want to implement a SIP connection with a PBX. Using the command line above, I can successfully register osmo-cc-sip-endpoint against my SIP PBX, but I am unable to make or receive any calls, even within osmocom-analog itself.

Theoretically, osmocom-analog with the option -x should be able to connect calls from one mobile to another. Both mobiles register successfully, but any number I dial from either mobile always connects the mobile to the waiting/queue music. The call never connects. The numbers are correct, and both mobiles successfully register against osmocom-analog.

I also tried osmo-cc-router, with the adapted routing.sh above, but the result was the same.

I simply do not know where to look next - I'm attaching the console output for cnetz and for osmo-cc-router.

I believe before I can address the issue of connecting through SIP, I must find out why even osmocom-analog itself does not connect one mobile to another despite the presence of one OgK and two SpK channels.

Can anyone give me a hint as to where to look from the console output, or is there any other diagnostic I could run? This is one of the unnerving issues where theroetically, everything should work as designed, and actually, it does not.

Thank you in advance!

I had to run an instance of osmo-cc-sip-endpoint for each phone on the network in a different console. Presumably at some point, osmo-cc-router would be what would set that up for you, but as we don't know how to use it yet, the sip-endpoint has to be set up manually. I also had to change the local port of the osmo-cc-sip-endpoint as well. This was done by changing for instance, -l 127.0.0.1:4203 (the port can be set to any port not in use.), and setting the phone number in the other arguments to the one you want that instance to route calls for. I found osmocom-analog was able to detect new instances of osmo-cc-sip-endpoints, at least when done locally.

As much as I've looked into the osmo-cc-router, at the moment, it seems useless without either some modifications or some instructions, but I did manage to get things working with osmo-cc-sip-endpoint alone.

Actions #10

Updated by atmega about 3 years ago

I am trying to make my osmocom analog NMT to connect to osmo-cc-sip-endpoint using this scheme :

osmo-cc-sip-endpoint -r [SIP_SERVER_IP] -l [OSMOCOM-ANALOG_IP] -A [PHONENUMBER] [SIP_PASSWORD] [DOMAIN/IP] --register [PHONENUMBER]@[DOMAIN/IP] --cc 'screen-called-in "" "[PHONENUMBER]"'

but all what I get is :

tport_vsend(0x7fd1940061f0): Invalid argument with (s=10 */213.218.117.66:5060)
nta: REGISTER (955973299): Invalid argument (22) with */[213.218.117.66]:5060
sip.c: 921 info : Received REGISTER response: 503 Service Unavailable (registration)

do I need to deal more with Asterisk or asterisk is not needed? What could be the reason that osmo-cc-sip-endpoint does not login to my sip phone provider? what I do wrong?

anybody could help directly ? please message me on

I dream to call PSTN from my NMT phone :D

Actions #11

Updated by mstamm about 3 years ago

aldude999 wrote:

As much as I've looked into the osmo-cc-router, at the moment, it seems useless without either some modifications or some instructions, but I did manage to get things working with osmo-cc-sip-endpoint alone.

Thank you for this explanation. I believe I will park this issue for the moment until I can get the routing of calls directly within osmocom-analog from one C-Netz mobile to another sorted out. I believe there is something fundamentally wrong with my setup, or something I'm just missing, although theoretically, this should work just fine. Calls between mobiles both registered with osmocom-analog should be possible without any other components outside osmocom-analog just by setting the -x command line argument and allocating at least two SpK channels in addition to the OgK channel, and I cannot even get this basic setup to work. I can call a mobile from the console, and the call will be signalled. If I answer the call, I get the "holding queue music". Likewise, if I place a call from one mobile to the other, using its registered number, I only get connected to the holding queue music, and the other mobile does not even ring. The console output is also somewhat unclear to me - at least I cannot readily understand what could be causing the issue. I will registere a separate issue and post some more logs, in the hope that someone may help me catch what I'm missing.

Actions #12

Updated by atmega about 3 years ago

Is there anybody who could help please? :-)

Actions #13

Updated by laforge about 3 years ago

Is there anybody who could help please? :-)

I think aside from jolly nobody in the "Typical osmocom developer team" has been
working with OsmoCC so far. And he doesn't seem very active here on the issue
tracker. Did you try reaching out directly by e-mail?

Actions #14

Updated by atmega about 3 years ago

Yes, I did try. So far no answer ;-( I will wait :-) thank you for your effort ;-) Still being excited to call from my NMT phone ;-) Regards Jacek

Dnia 6 marca 2021 14:49 laforge [REDMINE] <> napisał(a):

Issue #4971 has been updated by laforge.

Is there anybody who could help please? :-)

I think aside from jolly nobody in the "Typical osmocom developer team" has been
working with OsmoCC so far.  And he doesn't seem very active here on the issue
tracker.  Did you try reaching out directly by e-mail?

------------------------------
Feature #4971: OsmoCC Socket Documentation
osmocom.org osmocom.org

  • Author: foxrf
  • Status: New
  • Priority: Immediate
  • Assignee: jolly
  • Category:
  • Target version:
  • Spec Reference:
    ------------------------------
    It appears that the MNCC socket has been replaced with OSMOCC which does not appear to have ANY documentation around how you are actually supposed to configure call routing with this thing. More specially the osmo-cc-router package attempts to call a bash script "routing.sh" for which there is no sample or documentation going over the syntax. Please add full documentation on how this bash script is supposed to route calls and or provide a detailed example script.

---Files----------------------
Screenshot from 2021-01-22 16-20-23.png (175 KB)
IMG_3821.jpg (928 KB)
cnetz.txt (36.7 KB)
osmo-cc-router.txt (7.7 KB)

Actions #15

Updated by atmega about 3 years ago

I wonder what do I do wrong :

sip.c:1430 debug : Event 29 from SIP stack received (handle=0x55cb861d7980)
sip.c: 921 info : Received REGISTER response: 401 Unauthorized (registration)
sip.c: 943 debug : Register challenge received
sip.c: 178 debug : challenge order received
sip.c: 194 notice : No authentication header found
sip.c: 954 debug : Register failed, starting register timer
sip.c: 956 debug : destroying nua_handle 0x55cb861d7980 (register)

using this command line:

osmo-cc-sip-endpoint -r mysipnumber@mysipserverip -l localIPosmocom-analog -A SipAccountUser SipAccountPass --remote-auth --register SIPAccountUser@SipServerIp --cc 'screen-called-in "" "myNMTphone"' -P myPublicIP -v 0

Any ideas?

Actions #16

Updated by atmega about 3 years ago

Guys! I did it!!! My NMT Benefon called from PSTN Voip number.  It WORKS. Now working to make outgoing call! Regards to all! 

Dnia 6 marca 2021 15:36 <> napisał(a):

Yes, I did try. So far no answer ;-( I will wait :-) thank you for your effort ;-) Still being excited to call from my NMT phone ;-) Regards Jacek

Dnia 6 marca 2021 14:49 laforge [REDMINE] <> napisał(a):

Issue #4971 has been updated by laforge.

Is there anybody who could help please? :-)

I think aside from jolly nobody in the "Typical osmocom developer team" has been
working with OsmoCC so far.  And he doesn't seem very active here on the issue
tracker.  Did you try reaching out directly by e-mail?

------------------------------
Feature #4971: OsmoCC Socket Documentation
osmocom.org osmocom.org

  • Author: foxrf
  • Status: New
  • Priority: Immediate
  • Assignee: jolly
  • Category:
  • Target version:
  • Spec Reference:
    ------------------------------
    It appears that the MNCC socket has been replaced with OSMOCC which does not appear to have ANY documentation around how you are actually supposed to configure call routing with this thing. More specially the osmo-cc-router package attempts to call a bash script "routing.sh" for which there is no sample or documentation going over the syntax. Please add full documentation on how this bash script is supposed to route calls and or provide a detailed example script.

---Files----------------------
Screenshot from 2021-01-22 16-20-23.png (175 KB)
IMG_3821.jpg (928 KB)
cnetz.txt (36.7 KB)
osmo-cc-router.txt (7.7 KB)

Actions #17

Updated by mstamm about 3 years ago

atmega wrote:

Guys! I did it!!! My NMT Benefon called from PSTN Voip number.  It WORKS. Now working to make outgoing call! Regards to all! 

Congratulations!

I made some progress on cnetz and SIP today as well - incoming calls to the SIP account are signalled at the correct mobile, but when I answer the call on my mobile, the connection to the SIP server is not made - the SIP line continues ringing, and there is no connection made. Did you have to use any specific commands or switches, or did this issue not occur in your setup?

Actions #18

Updated by atmega about 3 years ago

When I call my public VOIP number osmo-cc-sip-endpiot calls pointed NMT phone over osmocom-analog osmo-cc and when I answer it I can talk! :D At the moment I am working with proper configuration to make outgoing call as somewhere I am missing authentication for VOIP outgoing calls and get SIP respond 403 followed by 407. Will work on it - perhaps tomorrow will post my logs and commands that did worked so far! I am so happy! Dreams come true! Even CallerID works! My Benefon Delta works great!  Respect to Jolly! 

Dnia 8 marca 2021 00:04 mstamm [REDMINE] <> napisał(a):

Issue #4971 has been updated by mstamm.

atmega wrote:

Guys! I did it!!!   My NMT Benefon called from PSTN Voip number.    It WORKS. Now working to make outgoing call!   Regards to all! 

Congratulations!

I made some progress on cnetz and SIP today as well - incoming calls to the SIP account are signalled at the correct mobile, but when I answer the call on my mobile, the connection to the SIP server is not made - the SIP line continues ringing, and there is no connection made. Did you have to use any specific commands or switches, or did this issue not occur in your setup?

------------------------------
Feature #4971: OsmoCC Socket Documentation
osmocom.org osmocom.org

  • Author: foxrf
  • Status: New
  • Priority: Immediate
  • Assignee: jolly
  • Category:
  • Target version:
  • Spec Reference:
    ------------------------------
    It appears that the MNCC socket has been replaced with OSMOCC which does not appear to have ANY documentation around how you are actually supposed to configure call routing with this thing. More specially the osmo-cc-router package attempts to call a bash script "routing.sh" for which there is no sample or documentation going over the syntax. Please add full documentation on how this bash script is supposed to route calls and or provide a detailed example script.

---Files----------------------
Screenshot from 2021-01-22 16-20-23.png (175 KB)
IMG_3821.jpg (928 KB)
cnetz.txt (36.7 KB)
osmo-cc-router.txt (7.7 KB)

Actions #19

Updated by aldude999 about 3 years ago

I had to make sure the encoding was either Alaw or ulaw, I'm not sure if any other codecs are supported. You can use -D on osmo-cc-sip-endpoint to output more SIP debug info. There's a lot of text, but you can output all the debug text to a file by adding:
2> out.log
to the end of the command.
I also found that NAT settings are extremely important for SIP, and even on a LAN-LAN network, if you don't have your external IP set correctly on the server, and sometimes even the client, audio doesn't always route. FreePBX has a panel in asterisk settings that let you set the external IP. You have to restart after setting it. the SIP Endpoint also has an argument for setting the public IP address, -P. I didn't have this set right at first and there would be no audio for about 30 seconds and then it would hang up automatically.

mstamm wrote:

atmega wrote:

Guys! I did it!!! My NMT Benefon called from PSTN Voip number.  It WORKS. Now working to make outgoing call! Regards to all! 

Congratulations!

I made some progress on cnetz and SIP today as well - incoming calls to the SIP account are signalled at the correct mobile, but when I answer the call on my mobile, the connection to the SIP server is not made - the SIP line continues ringing, and there is no connection made. Did you have to use any specific commands or switches, or did this issue not occur in your setup?

Actions #20

Updated by atmega about 3 years ago

Short update - I am working last few days on make outgoing call possible.. dozens of attempts...

here is what my command looks like :

osmo-cc-sip-endpoint --cc 'screen-calling-in "*" "*"' --cc 'screen-called-in "*" "3666090"' --cc 'screen-calling-out "*" "3666090"' --cc 'screen-called-out "*" "*"' -r -l 192.168.1.18 -P myPublicIp -R --remote-register -A mySIPuser mySIPpass mySIPprvider.com

All what I get is :

screen.c: 388 info : Screening outgoing caller ID '3600700':
screen.c: 403 info : -> type = subscriber
screen.c: 411 info : -> present = allowed
screen.c: 421 info : Comparing with rule #1: '*':
screen.c: 517 info : Rule matches, changing outgoing caller ID to '3666090'.
screen.c: 388 info : Screening outgoing dialed number '567':
screen.c: 391 info : -> type = unknown
screen.c: 421 info : Comparing with rule #1: '*':
screen.c: 517 info : Rule matches, changing outgoing dialed number to '567'.
sip.c: 463 info : Sending INVITE (callref 15)
endpoint.c: 923 info : Handle message CC-PROC-IND at state INIT-OUT (callref 15)
sip.c:1146 info : Received INVITE response: 407 Proxy Authentication Required (callref 15)
sip.c:1146 info : Received INVITE response: 403 SIP ID!=AUTH ID (callref 15)
endpoint.c: 923 info : Handle message CC-REL-IND at state PROCEEDING-OUT (callref 15)
endpoint.c: 740 info : Changing message to CC-DISC-IND.
endpoint.c: 923 info : Handle message CC-REL-REQ at state DISCONNECTING-IN (callref 15)

Always 403 sip error or 407...

is there a problem that my SIP provider does not use AuthID ?

Please guys help! I am dreaming also to make outgoing call! I did make incoming to my sip landline and it works, no way I can make outgoing call

What I do wrong ???

I post my screens - incoming and outgoing call, please help!

when I use config like this

osmo-cc-sip-endpoint -r MYsipAccountUsername@mySIPprov-ip -l (mylocallserverip) -A MYsipAccountUsername MYsipPASS --remote-auth --register MYsippAccountUsername@mySIPprov-ip --cc 'screen-called-in "mySIPaccname" "myNMTphoneNumber-3666090"' --cc 'screen-calling-out "*" "*"' --cc 'screen-called-out "*" "mysipaccname"' -P my piblicIP

- still I get this - but my incomig calls to my SIP public numer works and diverts to NMT phone

sip.c: 921 info : Received REGISTER response: 401 Unauthorized (registration)
sip.c: 921 info : Received REGISTER response: 200 OK (registration)
socket.c: 381 error : OsmoCC-Socket failed, socket cause 3.
endpoint.c: 923 info : Handle message CC-REL-REQ at state ATTACH-SENT (callref 2)
screen.c: 388 info : Screening outgoing caller ID '3666090':
screen.c: 403 info : -> type = subscriber
screen.c: 411 info : -> present = allowed
screen.c: 421 info : Comparing with rule #1: '*':
screen.c: 517 info : Rule matches, changing outgoing caller ID to '3666090'.
screen.c: 388 info : Screening outgoing dialed number '':
screen.c: 391 info : -> type = unknown
screen.c: 421 info : Comparing with rule #1: '*':
screen.c: 517 info : Rule matches, changing outgoing dialed number to 'atmega004'.
sip.c: 637 info : Sending INVITE response: 200 OK (callref 8)
endpoint.c: 923 info : Handle message CC-SETUP-COMP-IND at state CONNECTING-IN (callref 8)
sip.c:1343 info : Received BYE (callref 8)
sip.c:1358 info : Sending BYE response: 200 OK (callref 8)
endpoint.c: 923 info : Handle message CC-REL-IND at state ACTIVE (callref 8)
endpoint.c: 740 info : Changing message to CC-DISC-IND.
endpoint.c: 923 info : Handle message CC-REL-REQ at state DISCONNECTING-IN (callref 8)

So incoming calls works - but outgoing not... What do I do wrong?

Actions #21

Updated by aldude999 about 3 years ago

atmega wrote:

osmo-cc-sip-endpoint --cc 'screen-calling-in "*" "*"' --cc 'screen-called-in "*" "3666090"' --cc 'screen-calling-out "*" "3666090"' --cc 'screen-called-out "*" "*"' -r -l 192.168.1.18 -P myPublicIp -R --remote-register -A mySIPuser mySIPpass mySIPprvider.com

That looks like it might be wrong, screen calling out is changing your caller ID to the number you set it to, 3666090. If this doesn't match your SIP phone number (the number that shows up when you make a call from your SIP account), they will most likely block it because it looks like you're trying to spoof your phone number. If that matches your actual number you got from the SIP provider that should be fine though.

403 SIP ID!=AUTH ID

The SIP ID doesn't match the authenticated ID. Could be caused by the issue above or something else that we aren't aware of, such as the program not supporting all the possible SIP configurations (there are many more settings possible in SIP than the arguments in osmocc-sip-endpoint, for most cases it seems to be sufficient), or something weird going on with the provider in that they require non-default SIP options.

Actions #22

Updated by laforge 5 months ago

  • Priority changed from Immediate to Low
Actions

Also available in: Atom PDF

Add picture from clipboard (Maximum size: 48.8 MB)