[PJSIP] Incoming ITSP working at last! Is this a sane config

Get help with installing, upgrading and running Asterisk.

Moderators: muppetmaster, Moderator, Support

[PJSIP] Incoming ITSP working at last! Is this a sane config

Postby lardconcepts » Thu Nov 12, 2015 9:07 am

After 3-and-a-half long and frustrating days, I've finally figured out how to connect my ITSP (Voipfone) to an Asterisk install so that I can:

  • Play the correct message depending on the number being called.
  • Store the date/time/CID of the person calling and which group they called.
  • Not allow outgoing calls (message service only).

Note that with Voipfone, you can only have the calling number and any name set in the control panel.

The following config is designed to provide me with enough info as a learning basis, the idea being that anything from this point on is just dialplan - buy a number from Voipfone, give it a name in their control panel, and then just add a dialplan section with that name.

Does this look sane and safe for the time being?

pjsip.conf

Code: Select all
[simpletrans]
type = transport
protocol = UDP
bind = 0.0.0.0

[voipfone]
type = registration
retry_interval = 20
max_retries = 10
contact_user = 301XXXXX
transport = simpletrans
outbound_auth = voipfone-auth
server_uri = sip:301XXXXX@sip.voipfone.net:5060
;Note: IP in next line is MY Asterisk IP
client_uri = sip:301XXXXXN@46.101.37.X:5060

[voipfone-auth]
type = auth
auth_type = userpass
username = 301XXXXX
password = XXXXX

[voipfone-identify]
type = identify
endpoint = Elephant
; You cannot use FQDNs or hostnames. You must use IP addresses.
match = 195.189.173.27

[Elephant]
type = endpoint
transport=simpletrans
context = fromvoipfone
disallow = all
allow = alaw
outbound_auth = voipfone-auth

[acl]
type = acl
deny = 0.0.0.0/0.0.0.0
permit = 195.189.173.27


extensions.conf

Code: Select all
[fromvoipfone]
exten => _X.,1,Answer()
same => n,Set(VOLUME(TX)=8)
same => n,Wait(1)
same => n,DumpChan()
;same => n,SayNumber(${EXTEN})
same => n,Verbose(The caller ID all is ${CALLERID(all)})
same => n,Set(DB(${CALLERID(name)}/${CALLERID(num)})=${STRFTIME(${EPOCH},,%d%m%Y-%H:%M:%S)})
same => n,Playback(hello-world)
same => n,Goto(${CALLERID(name)},s,1)
;same = n,ControlPlayback(demo-instruct,5000,6,4,8,5)
same => n,Hangup()

[Chicken]
exten => s,1,Answer(500)
same => n,SayNumber(1)

[Elephant]
exten => s,1,Answer(500)
same => n,SayNumber(2)
lardconcepts
Newsterisk
 
Posts: 35
Joined: Tue Nov 11, 2014 2:13 pm

Return to Asterisk Support

Who is online

Users browsing this forum: No registered users and 1 guest