Outbound context important for incoming calls
I’ve been working on getting Tribox with Asterisk and Freebpx working over the last couple weeks as well.
While reading SIP debug logs today I discovered that with Freebpx and maybe Asterisk in general the outbound context is important as well.
So far example, in sip_additional.conf:
This wont work:
[vx-0.4]
type=peer
host=202.53.189.146
context=from-pstn
canreinvite=no
[vx-0.4-incoming]
type=user
host=161.29.0.4
context=from-pstn
canreinvite=no
but this will
[vx-0.4]
type=peer
host=161.29.0.4
context=from-pstn
canreinvite=no
[vx-0.4-incoming]
type=user
host=161.29.0.4
context=from-pstn
canreinvite=no
The first [vx-0.4] is in error, which makes Asterisk unable to match SIP return INVITE responses from the incoming call to the right context in the outbound section of the trunk config.
--- (24 headers 11 lines) ---
Using INVITE request as basis request - 32D0013-4ACD11DC-B8BE8D0A-40E27EC0@202.7.4.40
Sending to 161.29.0.4 : 5060 (non-NAT)
Found no matching peer or user for '161.29.0.4:5060'
Found RTP audio format 0
Found RTP audio format 101
So if your outbound asterisk calls work, but your inbound calls go to “So no service”.
Aug 16 12:06:49 DEBUG[28157] cdr_addon_mysql.c: cdr_mysql: SQL command as follows: INSERT INTO cdr
(calldate,clid,src,dst,dcontext,channel,dstchannel,
lastapp,lastdata,duration,billsec,disposition,amaflags,
accountcode,uniqueid) VALUES ('2007-08-16 12:06:45','09XXXXXX','09XXXXXXX','s','from-sip-external', 'SIP/202.7.4.40-087a52d0','','Playback','ss-noservice',4,4,'ANSWERED',3,'',
'1187222805.64')
the check your outbound context as well.