Howto get 'real' CALLERID(num)?

My GSM gateway is registered as extension 1002 with my Asterisk server and incoming calls go to 1200. (via _1300)

[incoming_mv370]
exten => _1300,1,NoOP(${CALLERID(num)})
exten => _1300,n,Dial(SIP/1200)

If a call comes in via the gateway, I see as CALLERID(num) 1002 in line
exten => _1300,1,NoOP(${CALLERID(num)})

fe:

  • Executing [1300@incoming_mv370:1] NoOp(“SIP/1002-0823f588”, “1002”) in new stack
  • Executing [1300@incoming_mv370:2] Dial(“SIP/1002-0823f588”, “SIP/1200”) in new stack
  • Called 1200

On extensions 1200, I see the real callerid of the (external) caller. :smile:

How can get the real calleridnum (not 1002)in my dial plan. :unamused:

Hi

Not beng able to see the sip.conf, you may ave already done this, But make sure there is no “callerid =” entry in it for 1002

Ian

[quote=“ianplain”]Hi

Not beng able to see the sip.conf, you may ave already done this, But make sure there is no “callerid =” entry in it for 1002

Ian[/quote]

;GSM VoIP Gateway MV-370
[1002]
type=friend
username=gsm_gateway
fromuser=1002
secret=mysecret
context=incoming_mv370
dtmfmode=inband
call-limit=1
host=dynamic
nat=no
canreinvite=no
insecure=yes
qualify=yes
disallow=all
allow=ulaw
allow=alaw

A call from the gateway to a sip soft phone (SJPhone) shows:
Incoming call from “+324768788xx” (the number calling the GSM gateway) :smiley:

A call from the gateway to a Dect sip phone
targa.nl/index.jsp?SID=0&NAV … =undefined
shows:
1002
"+324763788xx"
For IP

So the number “+324763788xx” is received by Asterisk and forwarded to the phone.
(but that number is not seen as the CALLERID(num) by Asterisk)

Shouldn’t this mean, that it must be possible to ‘catch’ that number and store it in a variable, for further processing ? :confused:

Unless I’m mistaken, the problem is that the GSM gateway is registering to the Asterisk box as a user, and therefore the user is known to Asterisk. So, that’s why the callerID is the SIP user ID.

You might try using re-invites. With re-invites set to “yes” the Asterisk box will tell the gateway to seek the other sip client directly instead of becoming a bridge between the two endpoints.

Set all of your SIP devices to reinvites=yes. Be sure to go through all of your clients and set the music on hold, and voicemail servers to be the IP address of your Asterisk box. That way, when you place calls on hold, the client will know where to park the call, and client will also know where to refer your calls for voicemail, and other processing.

Otherwise, I’d look through your GSM gateway documentation to see if there’s any settings you need to adjust to forward the callerID data on to the Asterisk box, or to set it up as a “peer” for the Asterisk.

[quote=“dufus”]
Otherwise, I’d look through your GSM gateway documentation to see if there’s any settings you need to adjust to forward the callerID data on to the Asterisk box, or to set it up as a “peer” for the Asterisk.[/quote]

The user manual is here:

portech.com.tw/eweb/MV370/mv370.htm

I will investigate your suggestion of re-invite :smile:

Finally I found THE solution. :smiley:

The caller id ‘number’ , forwarded from the GSM gateway to the phone, is actually stored in CALLERID(name) and NOT in CALLERID(num)

[incoming_mv370]
exten => _1300,1,NoOp(${CALLERID(name)})
exten => _1300,n,GotoIf($["${CALLERID(name)}"="+324763788xx"]?default,1200,1)   
exten => _1300,n,Dial(SIP/1206)

– Executing [1300@incoming_mv370:1] NoOp(“SIP/1002-b6519898”, “+324763788xx”) in new stack
– Executing [1300@incoming_mv370:2] GotoIf(“SIP/1002-b6519898”, “1?default|1200|1”) in new stack
– Goto (default,1200,1)

1 Like