No subject


Thu Jan 29 11:41:19 CET 2009


inbound and outbound trunking working for a system which does not
support registration.

After a lot of help, I've gotten the inbound DID forward to the equipment.

I was able to get the outbound trunking working nicely except for one
issue, for some reason the 'from' header is being rewritten to have the
ip address of the opensips server.
Should be '999.99.98.235' it ends up as '999.99.98.195'.
This makes it very hard for me to create a CDRTool account which allow
the customer to view there CDR's.
Its probably something very simple but I've spent all morning on it.

I placed below the opensips code and a call trace below.

Opensips code is (I've removed logic which would not interact with the
call):
-----
if(is_method("INVITE") && !is_uri_host_local() && !is_from_local()) {
    $var(group) = get_source_group(); # This will be the customer ID if
the source match's if not the case would be -1
    xlog("L_NOTICE", "External Call Group: $var(group)");
    switch ($var(group)) {
        case default:
         # Call is from a Trunking customer, billing details are set and
call is routed as normal
         append_hf("P-Called-Number: $tU\r\n");
         xlog("L_NOTICE", "Trunk: Call From $var(group) to $ruri\n");
         $avp(s:billing_party) = $var(group);
         if(alias_db_lookup("dbaliases","d")) {
         xlog("L_NOTICE", "LookupAlias: Found Local Alias for User via
$ruri");
         avp_db_load("$ruri/username", "*");
         $avp(s:X-Bill) = $rU;
         route(ROUTE_LOOKUPROUTE);
    }
 route(ROUTE_DEFAULTHANDLER)

route[ROUTE_LOOKUPROUTE] {
        if(do_routing("1")) {
                xlog("L_NOTICE", "LOOKUPROUTE: Found Route $ruri/username");
        }
}

route[ROUTE_DEFAULTHANDLER] {
        # when routing via usrloc, log the missed calls also
        setflag(2);

        # for INVITEs enable some additional helper routes
        if (is_method("INVITE")) {
                $avp(s:can_uri) = $ru;
                t_on_branch("ONBRANCH_ROUTE");
                t_on_reply("ONREPLY_ROUTE");
                t_on_failure("ONFAILURE_ROUTE");
        }

        if (!t_relay()) {
                sl_reply_error();
        };
        exit;
}
--------


SIP trace
------
Packet 1 at  from 999.99.98.195 to 888.88.246.16 (out)

INVITE sip:500210 at 888.88.246.16 SIP/2.0
Record-Route: <sip:999.99.98.195;lr=on;ftag=9212499524901340545;did=15d.30486f22>
Call-ID: MWYzMmY4ZGM5YmNhMDc3YmY3YWUwMTU5MmNkMDI3NjE..0
CSeq: 1 INVITE
From: "0899996049" <sip:0899996049 at 999.99.98.235>;tag=9212499524901340545
To: <sip:08XXXX3444 at 999.99.98.195;user=phone>
Via: SIP/2.0/UDP 999.99.98.195;branch=z9hG4bK88d9.a7a066b6.0
Via: SIP/2.0/UDP 999.99.98.235:5080;branch=z9hG4bK0185e82f58624978cf74824502c9ed61333830
Max-Forwards: 69
User-Agent: sipXecs/4.0.4 sipXecs/sipxbridge (Linux)
P-Asserted-Identity: <sip:500300 at 999.99.98.195>
Contact: <sip:500300 at 999.99.98.235:5080;transport=udp>
Session-Expires: 1800;refresher=uac
Allow: INVITE,BYE,ACK,CANCEL,OPTIONS
Content-Type: application/sdp
Content-Length: 409
P-hint: rr-enforced

v=0
o=sipxbridge 277362922869825655 1 IN IP4 999.99.98.235
s=Z
c=IN IP4 999.99.98.221
t=0 0
m=audio 50498 RTP/AVP 3 110 98 8 0 101
c=IN IP4 999.99.98.221
a=rtpmap:3 GSM/8000
a=rtpmap:110 speex/8000
a=rtpmap:98 iLBC/8000
a=fmtp:98 mode=30
a=rtpmap:8 PCMA/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15
a=sendrecv
a=x-sipx-ntap:X999.99.98.235-999.99.98.235;11

---
Packet 2 at  from 888.88.246.16 to 999.99.98.195 (in)

SIP/2.0 100 Trying
Via: SIP/2.0/UDP 999.99.98.195;branch=z9hG4bK88d9.a7a066b6.0;received=999.99.98.195
Via: SIP/2.0/UDP 999.99.98.235:5080;branch=z9hG4bK0185e82f58624978cf74824502c9ed61333830
Record-Route: <sip:999.99.98.195;lr=on;ftag=9212499524901340545;did=15d.30486f22>
From: "0899996049" <sip:0899996049 at 999.99.98.235>;tag=9212499524901340545
To: <sip:08XXXX3444 at 999.99.98.195;user=phone>
Call-ID: MWYzMmY4ZGM5YmNhMDc3YmY3YWUwMTU5MmNkMDI3NjE..0
CSeq: 1 INVITE
User-Agent: Asterisk PBX
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY
Supported: replaces
Contact: <sip:500210 at 888.88.246.16>
Content-Length: 0


---
Packet 3 at  from 888.88.246.16 to 999.99.98.195 (in)

SIP/2.0 180 Ringing
Via: SIP/2.0/UDP 999.99.98.195;branch=z9hG4bK88d9.a7a066b6.0;received=999.99.98.195
Via: SIP/2.0/UDP 999.99.98.235:5080;branch=z9hG4bK0185e82f58624978cf74824502c9ed61333830
Record-Route: <sip:999.99.98.195;lr=on;ftag=9212499524901340545;did=15d.30486f22>
From: "0899996049" <sip:0899996049 at 999.99.98.235>;tag=9212499524901340545
To: <sip:08XXXX3444 at 999.99.98.195;user=phone>;tag=as2b300621
Call-ID: MWYzMmY4ZGM5YmNhMDc3YmY3YWUwMTU5MmNkMDI3NjE..0
CSeq: 1 INVITE
User-Agent: Asterisk PBX
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY
Supported: replaces
Contact: <sip:500210 at 888.88.246.16>
Content-Length: 0


---
Packet 4 at  from 999.99.98.195 to 999.99.98.235 (out)

SIP/2.0 180 Ringing
Via: SIP/2.0/UDP 999.99.98.235:5080;branch=z9hG4bK0185e82f58624978cf74824502c9ed61333830
Record-Route: <sip:999.99.98.195;lr=on;ftag=9212499524901340545;did=15d.30486f22>
From: "0899996049" <sip:0899996049 at 999.99.98.235>;tag=9212499524901340545
To: <sip:08XXXX3444 at 999.99.98.195;user=phone>;tag=as2b300621
Call-ID: MWYzMmY4ZGM5YmNhMDc3YmY3YWUwMTU5MmNkMDI3NjE..0
CSeq: 1 INVITE
User-Agent: Asterisk PBX
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY
Supported: replaces
Contact: <sip:500210 at 888.88.246.16>
Content-Length: 0


---
Packet 5 at  from 888.88.246.16 to 999.99.98.195 (in)

SIP/2.0 200 OK
Via: SIP/2.0/UDP 999.99.98.195;branch=z9hG4bK88d9.a7a066b6.0;received=999.99.98.195
Via: SIP/2.0/UDP 999.99.98.235:5080;branch=z9hG4bK0185e82f58624978cf74824502c9ed61333830
Record-Route: <sip:999.99.98.195;lr=on;ftag=9212499524901340545;did=15d.30486f22>
From: "0899996049" <sip:0899996049 at 999.99.98.235>;tag=9212499524901340545
To: <sip:08XXXX3444 at 999.99.98.195;user=phone>;tag=as2b300621
Call-ID: MWYzMmY4ZGM5YmNhMDc3YmY3YWUwMTU5MmNkMDI3NjE..0
CSeq: 1 INVITE
User-Agent: Asterisk PBX
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY
Supported: replaces
Contact: <sip:500210 at 888.88.246.16>
Content-Type: application/sdp
Content-Length: 264

v=0
o=root 4763 4763 IN IP4 888.88.246.16
s=session
c=IN IP4 888.88.246.16
t=0 0
m=audio 18672 RTP/AVP 0 8 101
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=silenceSupp:off - - - -
a=ptime:20
a=sendrecv

---
Packet 6 at  from 999.99.98.195 to 999.99.98.235 (out)

SIP/2.0 200 OK
Via: SIP/2.0/UDP 999.99.98.235:5080;branch=z9hG4bK0185e82f58624978cf74824502c9ed61333830
Record-Route: <sip:999.99.98.195;lr=on;ftag=9212499524901340545;did=15d.30486f22>
From: "0899996049" <sip:0899996049 at 999.99.98.235>;tag=9212499524901340545
To: <sip:08XXXX3444 at 999.99.98.195;user=phone>;tag=as2b300621
Call-ID: MWYzMmY4ZGM5YmNhMDc3YmY3YWUwMTU5MmNkMDI3NjE..0
CSeq: 1 INVITE
User-Agent: Asterisk PBX
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY
Supported: replaces
Contact: <sip:500210 at 888.88.246.16>
Content-Type: application/sdp
Content-Length: 265

v=0
o=root 4763 4763 IN IP4 888.88.246.16
s=session
c=IN IP4 999.99.98.221
t=0 0
m=audio 50496 RTP/AVP 0 8 101
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=silenceSupp:off - - - -
a=ptime:20
a=sendrecv

---
Packet 7 at  from 999.99.98.195 to 888.88.246.16 (out)

ACK sip:500210 at 888.88.246.16 SIP/2.0
Call-ID: MWYzMmY4ZGM5YmNhMDc3YmY3YWUwMTU5MmNkMDI3NjE..0
CSeq: 1 ACK
Via: SIP/2.0/UDP 999.99.98.195;branch=z9hG4bK88d9.a7a066b6.2
Via: SIP/2.0/UDP 999.99.98.235:5080;branch=z9hG4bKfcc14913aed4ca2e7f9f2480d038401d333830
From: "0899996049" <sip:0899996049 at 999.99.98.235>;tag=9212499524901340545
To: <sip:08XXXX3444 at 999.99.98.195;user=phone>;tag=as2b300621
Max-Forwards: 69
User-Agent: sipXecs/4.0.4 sipXecs/sipxbridge (Linux)
Content-Length: 0


---
Packet 8 at  from 999.99.98.195 to 999.99.98.235 (out)

BYE sip:500300 at 999.99.98.235:5080;transport=udp SIP/2.0
Via: SIP/2.0/UDP 999.99.98.195;branch=z9hG4bK12cb.cf43eb92.0
Via: SIP/2.0/UDP 888.88.246.16:5060;received=888.88.246.16;branch=z9hG4bK2465459e;rport=5060
From: <sip:08XXXX3444 at 999.99.98.195;user=phone>;tag=as2b300621
To: "0899996049" <sip:0899996049 at 999.99.98.235>;tag=9212499524901340545
Call-ID: MWYzMmY4ZGM5YmNhMDc3YmY3YWUwMTU5MmNkMDI3NjE..0
CSeq: 102 BYE
User-Agent: Asterisk PBX
Max-Forwards: 69
Content-Length: 0


---
Packet 9 at  from 999.99.98.235 to 999.99.98.195 (in)

SIP/2.0 100 Trying
Via: SIP/2.0/UDP 999.99.98.195;branch=z9hG4bK12cb.cf43eb92.0
Via: SIP/2.0/UDP 888.88.246.16:5060;received=888.88.246.16;branch=z9hG4bK2465459e;rport=5060
From: <sip:08XXXX3444 at 999.99.98.195;user=phone>;tag=as2b300621
To: "0899996049" <sip:0899996049 at 999.99.98.235>
Call-ID: MWYzMmY4ZGM5YmNhMDc3YmY3YWUwMTU5MmNkMDI3NjE..0
CSeq: 102 BYE
Server: sipXecs/4.0.4 sipXecs/sipxbridge (Linux)
Contact: <sip:~~id~bridge at 999.99.98.235:5080>
Supported: replaces
Content-Length: 0


---
Packet 10 at  from 999.99.98.235 to 999.99.98.195 (in)

SIP/2.0 200 OK
Via: SIP/2.0/UDP 999.99.98.195;branch=z9hG4bK12cb.cf43eb92.0
Via: SIP/2.0/UDP 888.88.246.16:5060;received=888.88.246.16;branch=z9hG4bK2465459e;rport=5060
From: <sip:08XXXX3444 at 999.99.98.195;user=phone>;tag=as2b300621
To: "0899996049" <sip:0899996049 at 999.99.98.235>;tag=9212499524901340545
Call-ID: MWYzMmY4ZGM5YmNhMDc3YmY3YWUwMTU5MmNkMDI3NjE..0
CSeq: 102 BYE
Server: sipXecs/4.0.4 sipXecs/sipxbridge (Linux)
Contact: <sip:~~id~bridge at 999.99.98.235:5080>
Supported: replaces
Content-Length: 0


---
Packet 11 at  from 999.99.98.195 to 888.88.246.16 (out)

SIP/2.0 200 OK
Via: SIP/2.0/UDP 888.88.246.16:5060;received=888.88.246.16;branch=z9hG4bK2465459e;rport=5060
From: <sip:08XXXX3444 at 999.99.98.195;user=phone>;tag=as2b300621
To: "0899996049" <sip:0899996049 at 999.99.98.235>;tag=9212499524901340545
Call-ID: MWYzMmY4ZGM5YmNhMDc3YmY3YWUwMTU5MmNkMDI3NjE..0
CSeq: 102 BYE
Server: sipXecs/4.0.4 sipXecs/sipxbridge (Linux)
Contact: <sip:~~id~bridge at 999.99.98.235:5080>
Supported: replaces
Content-Length: 0



--------------070606030105090707080709
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>

<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
</head>
<body bgcolor="#ffffff" text="#000000">
Hi All<br>
<br>


More information about the Users mailing list