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.