[SR-Users] Routing incoming calls to Asterisk trunk

Teleport Engineer teleport.engineer at gmail.com
Wed May 7 02:42:00 CEST 2014


Hello,

I'd setup a test environment where Kamailio accepts external invites and
routes them to an internal Asterisk (actually working as an SBC).
My dialplan works fine routing the INVITE to the internal Asterisk, but the
SIP message goes into the defaul sip context (the one configured in sip
general), and not in the context defined for the sip trunk between Kamailio
and Asterisk.

The sip trunk is configured like this:

[kamailio]
disallow=all
host=kamailio
port=5060
insecure=port,invite
type=friend
context=from-sip-external
fromdomain=mydomain
qualify=yes
allow=alaw
allow=g722

So I expect that all the sip invites coming from kamailio should be
executed in  from-sip-external context.

But it doesn't work like this since each invite goes in the default context.

The invite that goes to Asterisk is like this

<--- SIP read from kamailio-external:5060 --->
INVITE sip:extension at asterisk:5060;transport=UDP SIP/2.0
Record-Route: <sip:kamailio-external:5060;nat=yes;ftag=905e4921;lr=on>
Via: SIP/2.0/UDP kamailio-external:5060;branch=z9hG4bK277a.aea3ad87.0
Via: SIP/2.0/UDP
caller:28021;rport=28019;received=caller;branch=z9hG4bK-d8754z-d11f1fa1d0fb2ab4-1---d8754z-
Max-Forwards: 69
Contact: <sip:524 at caller:28019;transport=UDP>
To: <sip:extension at kamailio-external>
From: <sip:524 at caller:28007>;tag=905e4921
Call-ID: YzEzMDM1NDZhZTllMTRiMDJmY2MyZTE0ZWZjMzE5OTc.
CSeq: 1 INVITE
Allow: INVITE, ACK, CANCEL, BYE, NOTIFY, REFER, MESSAGE, OPTIONS, INFO,
SUBSCRIBE
Supported: replaces, norefersub, extended-refer, timer, X-cisco-serviceuri
User-Agent: Z 3.2.21357 r21367
Allow-Events: presence, kpml
Content-Type: application/sdp
Content-Length: 260

What I think is that in the sip message there is no information about
kamailio internal ip address but only about kamailio-external address and
then Asterisk put it into the default context.
If this is the reason, should I change the trunk ip address in Asterisk and
should I do some manipulation on the incoming packet on kamailio?
Or maybe I should use kamailio-external as fromdomain in the trunk
configuration?

Thanks.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-users/attachments/20140506/cd228afe/attachment.html>


More information about the sr-users mailing list