Asterisk forgetting context for SIP trunks

Discussion in 'UK VOIP' started by alexd, May 7, 2007.

  1. alexd

    alexd Guest

    I've been getting reports that people can't dial my voip.co.uk or Sipgate
    numbers, and a few test calls reveal:

    Sending to 217.10.79.23 : 5060 (non-NAT)
    Found RTP audio format 8
    <snip loads of this>
    Found RTP audio format 10
    Peer audio RTP is at port 217.10.66.71:12052
    Found description format PCMA
    <snip loads of this>
    Found description format L16
    Capabilities: us - 0x8000e (gsm|ulaw|alaw|h263), peer - audio=0x5fe (gsm
    ulaw|alaw|g726|adpcm|slin|lpc10|g729|ilbc)/video=0x0 (nothing), combined -
    0xe (gsm|ulaw|alaw)
    Non-codec capabilities: us - 0x1 (telephone-event), peer - 0x0 (nothing),
    combined - 0x0 (nothing)
    Looking for 640xxxx in default (domain 85.189.113.174)
    Reliably Transmitting (no NAT) to 217.10.79.23:5060:
    SIP/2.0 404 Not Found
    Via: SIP/2.0/UDP
    217.10.79.23;branch=z9hG4bK7a1b.e8753713.0;received=192.168.254.2
    Via: SIP/2.0/UDP 217.10.79.8;branch=z9hG4bK7a1b.407746b2.0
    Via: SIP/2.0/UDP 217.10.66.71:5060;branch=z9hG4bK16462595;rport=5060
    From: "0x9x4x4x4x3" <sip:0x9x4x4x4x3@217.10.66.71>;tag=as639fe80a
    To: <sip:44191640xxxx@217.10.79.8>;tag=as56ddf6fc
    Call-ID: 14efe9852138a7c928aef19e7554857a@217.10.66.71
    CSeq: 102 INVITE
    User-Agent: Asterisk PBX
    Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY
    Content-Length: 0


    [default] isn't where I want the calls to go - it should be
    [incoming_sipgate] or [incoming_voipcouk] as appropriate. The trunks each
    have the relevant context in sip.conf.

    Restarting Asterisk will get incoming calls working again for a few minutes:


    <-- SIP read from 217.10.79.23:5060:
    INVITE sip:640xxxx@85.189.113.174 SIP/2.0
    Record-Route: <sip:217.10.79.23;lr=on>
    Record-Route: <sip:217.10.79.8;ftag=as027acffd;lr=on>
    Via: SIP/2.0/UDP 217.10.79.23;branch=z9hG4bKa8f4.94b368a1.0
    Via: SIP/2.0/UDP 217.10.79.8;branch=z9hG4bKa8f4.26f50137.0
    Via: SIP/2.0/UDP 217.10.66.71:5060;branch=z9hG4bK78e3fb9a;rport=5060
    From: "0x9x4x4x4x3" <sip:0x9x4x4x4x3@217.10.66.71>;tag=as027acffd
    To: <sip:44191640xxxx@217.10.79.8>
    Contact: <sip:0x9x4x4x4x3@217.10.66.71>
    Call-ID: 763bb79f09c49a3c4a56ff2f59f587b3@217.10.66.71
    CSeq: 102 INVITE
    User-Agent: sipgate asterisk
    Max-Forwards: 15
    Date: Mon, 07 May 2007 21:26:05 GMT
    Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY
    Supported: replaces
    Content-Type: application/sdp
    Content-Length: 426

    v=0
    o=root 15612 15612 IN IP4 217.10.66.71
    s=session
    c=IN IP4 217.10.66.71
    t=0 0
    m=audio 19300 RTP/AVP 8 0 3 97 18 111 5 7 10
    a=rtpmap:8 PCMA/8000
    <snip loads of this>
    a=rtpmap:10 L16/8000
    a=silenceSupp:eek:ff - - - -
    a=ptime:20
    a=sendrecv

    --- (18 headers 20 lines) ---
    Using INVITE request as basis request -
    763bb79f09c49a3c4a56ff2f59f587b3@217.10.66.71
    Sending to 217.10.79.23 : 5060 (non-NAT)
    Found peer 'sipgate'
    Found RTP audio format 8
    <snip loads of this>
    Found RTP audio format 10
    Peer audio RTP is at port 217.10.66.71:19300
    Found description format PCMA
    <snip loads of this>
    Found description format L16
    Capabilities: us - 0x2 (gsm), peer - audio=0x5fe (gsm|ulaw|alaw|g726|adpcm
    slin|lpc10|g729|ilbc)/video=0x0 (nothing), combined - 0x2 (gsm)
    Non-codec capabilities: us - 0x1 (telephone-event), peer - 0x0 (nothing),
    combined - 0x0 (nothing)
    Looking for 640xxxx in incoming_sipgate (domain 85.189.113.174)
    list_route: hop: <sip:217.10.79.23;lr=on>
    list_route: hop: <sip:217.10.79.8;ftag=as027acffd;lr=on>
    Transmitting (no NAT) to 217.10.79.23:5060:
    SIP/2.0 100 Trying
    Via: SIP/2.0/UDP
    217.10.79.23;branch=z9hG4bKa8f4.94b368a1.0;received=217.10.79.23
    Via: SIP/2.0/UDP 217.10.79.8;branch=z9hG4bKa8f4.26f50137.0
    Via: SIP/2.0/UDP 217.10.66.71:5060;branch=z9hG4bK78e3fb9a;rport=5060
    From: "0x9x4x4x4x3" <sip:0x9x4x4x4x3@217.10.66.71>;tag=as027acffd
    To: <sip:44191640xxxx@217.10.79.8>
    Call-ID: 763bb79f09c49a3c4a56ff2f59f587b3@217.10.66.71
    CSeq: 102 INVITE
    User-Agent: Asterisk PBX
    Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY
    Contact: <sip:640xxxx@85.189.113.174>
    Content-Length: 0


    But usually within 10 minutes, they've stopped working. I've followed the
    advice at http://forums.digium.com/viewtopic.php?p=49136 and changed my
    insecure = very to insecure = port,invite. Even when it isn't working, the
    context for the peer is right, it's just that calls don't go to the right
    place:

    westogre*CLI> sip show peer sipgate

    * Name : sipgate
    Secret : <Set>
    MD5Secret : <Not set>
    Context : incoming_sipgate


    Can anyone suggest anything, short of putting everything in [default]?

    --
    <http://ale.cx/> (AIM:troffasky) ()
    22:31:15 up 9 days, 30 min, 1 user, load average: 0.52, 0.45, 0.32
    09 f9 11 02 9d 74 e3 5b d8 41 56 c5 63 56 88 c0
     
    alexd, May 7, 2007
    #1
    1. Advertising

  2. alexd

    alexd Guest

    alexd wrote:

    > Can anyone suggest anything, short of putting everything in [default]?


    The answer to my own question is, "fix the iptables port forwarding rules on
    your gateway so that forwarded traffic originates from it's actual source
    address rather than that of the gateway". So Asterisk was behaving exactly
    to spec - the port-forwarded SIP traffic appeared to Asterisk to be coming
    from the gateway rather than from Sipgate or voip.co.uk, so Asterisk sent
    all the inbound calls to default because it has no idea [in SIP terms] what
    the gateway is.

    --
    <http://ale.cx/> (AIM:troffasky) ()
    21:43:01 up 10 days, 23:42, 2 users, load average: 0.56, 0.34, 0.26
    09 f9 11 02 9d 74 e3 5b d8 41 56 c5 63 56 88 c0
     
    alexd, May 9, 2007
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Sean
    Replies:
    5
    Views:
    560
  2. SIP trunks and DID's

    , Jun 30, 2006, in forum: UK VOIP
    Replies:
    4
    Views:
    2,841
    Peter Gradwell
    Jul 2, 2006
  3. phpguy
    Replies:
    4
    Views:
    999
    Paul Hayes
    Nov 12, 2007
  4. phpguy
    Replies:
    13
    Views:
    946
  5. Giuen
    Replies:
    0
    Views:
    1,251
    Giuen
    Sep 12, 2008
Loading...

Share This Page