Config asterisk for SIP mobile network

I want to implement asterisk with a AGI application for a IVR system to a mobile network system.
How can I configure a end point in pjsip.conf to accept requests from any mobile number. Request is coming through a SIP channel with relevant mobile number.
Then from the extention.conf it directs to AGI application and after some processing application should call to a relevant number which is dynamic. Lets say it is a customer care agent.
The problem I’m having is how to handle these dynamic numbers.
How to define end points to handle dynamic numbers through SIP trunk

this is the invite request I m getting from asterisk end

NOTICE[5717]: res_pjsip/pjsip_distributor.c:676 log_failed_request: Request ‘INVITE’ from ‘“76XXXXXX” sip:76XXXXXX@;user=phone’ failed for ‘’ (callid: svsb9shgdcfhfcgu9t9sstgbqgqiveii@ - No matching endpoint found

if an end point added for [76XXXXXX] this works.
But I want any number to work, as we cant create end points for every number

You need to authenticate based on IP for your SIP trunk. Look at this blog for such options.

Thanks, it worked. I was able to grab incoming calls from any number by using ip identification.
Now the problem is how to initiate a call to a unregistered mobile number from Asterisk end. When I register a soft phone and make a call to it from a mobile number it works fine. But when try to reach a unregistered mobile number it says that the channel cannot be created

== Setting global variable ‘SIPDOMAIN’ to ‘’
– Executing [79000@from-internal:1] Dial(“PJSIP/adl-00000000”, “PJSIP/761408054”) in new stack
[Mar 3 17:39:35] ERROR[11311]: res_pjsip.c:3534 ast_sip_create_dialog_uac: Endpoint ‘761408054’: Could not create dialog to invalid URI ‘761408054’. Is endpoint registered and reachable?
[Mar 3 17:39:35] ERROR[11311]: chan_pjsip.c:2656 request: Failed to create outgoing session to endpoint ‘761408054’
[Mar 3 17:39:35] WARNING[11332][C-00000001]: app_dial.c:2576 dial_exec_full: Unable to create channel of type ‘PJSIP’ (cause 3 - No route to destination)
– No devices or endpoints to dial (technology/resource)
– Executing [79000@from-internal:2] Hangup(“PJSIP/adl-00000000”, “”) in new stack
== Spawn extension (from-internal, 79000, 2) exited non-zero on ‘PJSIP/adl-00000000’

You need to have the SIP endpoint registered otherwise set contact to the IP of the endpoint in aor section for the endpoint.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.