Integrating a GSM gateway with Asterisk

Hi,

I installed an AsteriskNOW 6.11 on a virtual machine and I’m trying to integrate it with an OpenVox GSM Gateway. I tried following the How-to’s i found online but I can’t successfully receive calls through the GSM gateway to a SIP phone registered with my AsteriskNOW. Here is my current setup:

GSM Gateway — AsteriskNOW (Trunk 2001) — SIP Phone (3001)

I setup GSM gateway to register with SIP trunk 2001 on AsteriskNOW server.
I setup the trunk with the following settings:

Trunk Name: 2001
host=<gsmgateway IP>
username=2001
secret=2001
type=friend
fromuser=2001
allow=alaw&ulaw
context=from-internal

And I have an extension registered with the AsteriskNOW (3001 and 2003).

I can make internal calls between 3001 and 2003, so I’m guessing my Asterisk setup is OK. However, when I try to call the GSM gateway, it doesn’t get routed to any of the extensions and goes busy after 4 rings. When I look at the system status, there is a spike on active calls but not sure why it doesn’t go through. Would like to hear your thoughts about this. Thanks.

additional context. i’m able to make outgoing calls from the extension going through asteriskNow and the GSM gateway so I would assume the connection between the two systems is OK. Just having problems on the inbound side. When setting up the trunk, I noticed only the “Outbound Settings” are setup. I tried copying the same settings on the Inbound side but to no avail. Help would be very much appreciated. Thanks!

Probably you’ll have a configuration option in GSM gateway to forward all incoming calls to this SIP trunk.
Do you see anything in Asterisk CLI when you test inbound? If yes then paste your output.

–Satish Barot

Yes, GSM gateway is configured to forward all incoming calls to this SIP trunk. The configuration is just the reverse of the outgoing (on GSM gateway side), meaning I just swapped to and from.

I do get logs on Asterisk CLI when I test inbound these are the logs:

Connected to Asterisk 11.16.0 currently running on localhost (pid = 1744)
== Using SIP RTP TOS bits 184
== Using SIP RTP CoS mark 5
> [INSERT INTO cel (eventtype,eventtime,cid_name,cid_num,cid_ani,cid_rdnis,cid_dnid,exten,context,channame,appname,appdata,amaflags,accountcode,uniqueid,linkedid,peer,userdeftype,userfield) VALUES (‘CHAN_START’,{ts ‘2016-09-04 18:05:13.347116’},‘09178304419’,‘09178304419’,’’,’’,’’,‘2001’,‘from-internal’,‘SIP/2001-0000001d’,’’,’’,3,’’,‘1472983513.29’,‘1472983513.29’,’’,’’,’’)]
– Executing [2001@from-internal:1] ResetCDR(“SIP/2001-0000001d”, “”) in new stack
– Executing [2001@from-internal:2] NoCDR(“SIP/2001-0000001d”, “”) in new stack
– Executing [2001@from-internal:3] Progress(“SIP/2001-0000001d”, “”) in new stack
– Executing [2001@from-internal:4] Wait(“SIP/2001-0000001d”, “1”) in new stack
> 0x7f2c6c03d790 – Probation passed - setting RTP source address to 10.30.24.10:18060
– Executing [2001@from-internal:5] Progress(“SIP/2001-0000001d”, “”) in new stack
– Executing [2001@from-internal:6] Playback(“SIP/2001-0000001d”, “silence/1&cannot-complete-as-dialed&check-number-dial-again,noanswer”) in new stack
– <SIP/2001-0000001d> Playing ‘silence/1.alaw’ (language ‘en’)
– <SIP/2001-0000001d> Playing ‘cannot-complete-as-dialed.alaw’ (language ‘en’)
– <SIP/2001-0000001d> Playing ‘check-number-dial-again.alaw’ (language ‘en’)
– Executing [2001@from-internal:7] Wait(“SIP/2001-0000001d”, “1”) in new stack
– Executing [2001@from-internal:8] Congestion(“SIP/2001-0000001d”, “20”) in new stack
[2016-09-04 18:05:21] WARNING[7289][C-00000021]: channel.c:4860 ast_prod: Prodding channel ‘SIP/2001-0000001d’ failed
== Spawn extension (from-internal, 2001, 8) exited non-zero on ‘SIP/2001-0000001d’
– Executing [h@from-internal:1] Hangup(“SIP/2001-0000001d”, “”) in new stack
== Spawn extension (from-internal, h, 1) exited non-zero on ‘SIP/2001-0000001d’
> [INSERT INTO cel (eventtype,eventtime,cid_name,cid_num,cid_ani,cid_rdnis,cid_dnid,exten,context,channame,appname,appdata,amaflags,accountcode,uniqueid,linkedid,peer,userdeftype,userfield) VALUES (‘HANGUP’,{ts ‘2016-09-04 18:05:21.250508’},‘09178304419’,‘09178304419’,‘09178304419’,’’,‘2001’,‘h’,‘from-internal’,‘SIP/2001-0000001d’,’’,’’,3,’’,‘1472983513.29’,‘1472983513.29’,’’,’’,’’)]
> [INSERT INTO cel (eventtype,eventtime,cid_name,cid_num,cid_ani,cid_rdnis,cid_dnid,exten,context,channame,appname,appdata,amaflags,accountcode,uniqueid,linkedid,peer,userdeftype,userfield) VALUES (‘CHAN_END’,{ts ‘2016-09-04 18:05:21.251603’},‘09178304419’,‘09178304419’,‘09178304419’,’’,‘2001’,‘h’,‘from-internal’,‘SIP/2001-0000001d’,’’,’’,3,’’,‘1472983513.29’,‘1472983513.29’,’’,’’,’’)]
> [INSERT INTO cel (eventtype,eventtime,cid_name,cid_num,cid_ani,cid_rdnis,cid_dnid,exten,context,channame,appname,appdata,amaflags,accountcode,uniqueid,linkedid,peer,userdeftype,userfield) VALUES (‘LINKEDID_END’,{ts ‘2016-09-04 18:05:21.252305’},‘09178304419’,‘09178304419’,‘09178304419’,’’,‘2001’,‘h’,‘from-internal’,‘SIP/2001-0000001d’,’’,’’,3,’’,‘1472983513.29’,‘1472983513.29’,’’,’’,’’)]

So I’m guessing the Gateway is able to send the call to Asterisk but Asterisk does not know which extension to forward it to? I’m not sure, please help. Thank you.

Ok, so I got the inbound route working at the expense of the outbound route. It seems setting host = ipaddr of gateway allows Outbound but not Inbound, and setting host=dynamic allows Inbound but not Outbound.

I get a Server unreachable error on my softphone when trying to make outbound calls with dynamic setting.

ANy workarounds for this? Still trying to find one. Thanks.

Able to fix this. From CLI logs it showed that the call was coming in with context [from-sip-external] so when i changed dial plan in extensions.conf, it worked. Though at times it still fails but I’m assuming that’s more on the resource side since I’m running on Virtual Box only for testing.