[Serusers] avpops question

olivier.taylor olivier.taylor at gmail.com
Thu Mar 23 17:18:51 CET 2006


yes sir, that's what I need

and I wonder how to get it :(

cheers,

Olivier

Steve Blair a écrit :
>
> Just so I'm clear, what you want is the "7321073" part of the From 
> address, correct?
>
> -Steve
>
> olivier.taylor wrote:
>
>> here we are  :)
>>
>> 88.88.88.84 is the asterisk generating the call
>> 88.88.88.83 is  SER
>> 88.88.88.89 is a pstn gateway
>>
>>
>> we have
>> 88.88.88.84 --> 88.88.88.83  --> 88.88.88.89
>> asterisk               SER                     Pstn gateway
>>
>> initial invite going to ser from asterisk
>>
>> U 88.88.88.84:5060 -> 88.88.88.83:5060
>> INVITE sip:003227321073 at toto.com SIP/2.0.
>> Via: SIP/2.0/UDP 88.88.88.84:5060;branch=z9hG4bK6c6f6e3a;rport.
>> From: "7321073" <sip:123456 at toto.com>;tag=as66857880.
>> To: <sip:003227321073 at finalcut.be>.
>> Contact: <sip:123456 at 88.88.88.84>.
>> Call-ID: 79c32ec07d327db37ddab2fb211cbd4a at toto.com.
>> CSeq: 103 INVITE.
>> User-Agent: Phonext Pbx.
>> Max-Forwards: 70.
>> Proxy-Authorization: Digest username="123456", realm="finalcut.be", 
>> algorithm=MD5, uri="sip:003227321073 at toto.com", 
>> nonce="4422b15f6ee5477116355cd454befe82f159112d", 
>> response="d6bf375d764e044e0b9ee6574fa2e650", opaque="".
>> Date: Thu, 23 Mar 2006 14:26:25 GMT.
>> Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY.
>> Content-Type: application/sdp.
>> Content-Length: 310.
>> .
>> v=0.
>> o=root 1042 1043 IN IP4 88.88.88.84.
>> s=session.
>> c=IN IP4 88.88.88.84.
>> t=0 0.
>> m=audio 18244 RTP/AVP 18 0 8 3 101.
>> a=rtpmap:18 G729/8000.
>> a=fmtp:18 annexb=no.
>> a=rtpmap:0 PCMU/8000.
>> a=rtpmap:8 PCMA/8000.
>> a=rtpmap:3 GSM/8000.
>> a=rtpmap:101 telephone-event/8000.
>> a=fmtp:101 0-16.
>> a=silenceSupp:off - - - -.
>>
>>
>> ngrep after transformation from SER going to the pstn gateway
>>      avp_write("$from/username", "$ocn");
>>      avp_pushto("$X-From", "$ocn");
>>
>> U 88.88.88.83:5060 -> 88.88.88.89:5060
>> INVITE sip:3227321073 at 88.88.88.89:5060 SIP/2.0.
>> Record-Route: 
>> <sip:003227321073 at 88.88.88.83:5060;nat=yes;ftag=as66857880;lr=on>.
>> Via: SIP/2.0/UDP 88.88.88.83;branch=z9hG4bKd636.284afc5.0.
>> Via: SIP/2.0/UDP 88.88.88.84:5060;branch=z9hG4bK6c6f6e3a;rport=5060.
>> From: "7321073" <sip:123456 at toto.com>;tag=as66857880.
>> To: <sip:003227321073 at toto.com>.
>> Contact: <sip:123456 at 88.88.88.84>.
>> Call-ID: 79c32ec07d327db37ddab2fb211cbd4a at toto.com.
>> CSeq: 103 INVITE.
>> User-Agent: Phonext Pbx.
>> Max-Forwards: 16.
>> Date: Thu, 23 Mar 2006 14:26:25 GMT.
>> Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY.
>> Content-Type: application/sdp.
>> Content-Length: 330.
>> X-Feature: WebCall.
>> X-Forwarded: Yes.
>> X-From: 123456.
>> .
>> v=0.
>> o=root 1042 1043 IN IP4 88.88.88.84.
>> s=session.
>> c=IN IP4 88.88.88.84.
>> t=0 0.
>> m=audio 18244 RTP/AVP 18 0 8 3 101.
>> a=rtpmap:18 G729/8000.
>> a=fmtp:18 annexb=no.
>> a=rtpmap:0 PCMU/8000.
>> a=rtpmap:8 PCMA/8000.
>> a=rtpmap:3 GSM/8000.
>> a=rtpmap:101 telephone-event/8000.
>> a=fmtp:101 0-16.
>> a=silenceSupp:off - - - -.
>> a=direction:active.
>>
>>
>>
>> Steve Blair a écrit :
>>
>>>
>>> Do you have a ngrep snapshot of this packet ?
>>>
>>> olivier.taylor wrote:
>>>
>>>> Hi Steve,
>>>>
>>>> first of all, thanks for a so fast answer :)
>>>>
>>>> The problem is the result I get,
>>>> after the avp_write, I use avp_pushto to create a new header (to be 
>>>> used for the billing).
>>>>
>>>>        avp_write("$from/username", "$ocn");
>>>>        avp_pushto("$X-From", "$ocn");
>>>>
>>>> and I get :
>>>>        X-From: 69
>>>> as header, I 'dlike to have
>>>>        X-From: 45454558
>>>>
>>>> Olivier
>>>>
>>>>
>>>> Steve Blair a écrit :
>>>>
>>>>>
>>>>>
>>>>> olivier.taylor wrote:
>>>>>
>>>>>> hi all,
>>>>>>
>>>>>> Using ser 0.94
>>>>>> I have a sip message coming from an asterisk containing : From: 
>>>>>> "45454558" <sip:69 at toto.com>;tag=as2524cec1.
>>>>>> I need to extract the 45454558 and add it in a new header.
>>>>>
>>>>>
>>>>>
>>>>> Did you try something like:
>>>>>
>>>>> modparam("avpops", "avp_aliases","ocn=i:701")
>>>>> avp_write("$from/username", "$ocn");
>>>>>
>>>>> Then use $ocn as an alias whereever you need to reference this 
>>>>> username.
>>>>>
>>>>> -Steve
>>>>>
>>>>>>
>>>>>> I there a way to do that with avpops?
>>>>>>
>>>>>> I tried avp_write("$from", "s:from"); and get sip:69 at toto.com
>>>>>> also avp_write("$from/username", "s:from"); and get 69
>>>>>>
>>>>>> is there another way?
>>>>>>
>>>>>> Cheers,
>>>>>>
>>>>>> Olivier
>>>>>>
>>>>>>
>>>>>> _______________________________________________
>>>>>> Serusers mailing list
>>>>>> serusers at lists.iptel.org
>>>>>> http://lists.iptel.org/mailman/listinfo/serusers
>>>>>
>>>>>
>>>>>
>>>>>
>>>
>




More information about the sr-users mailing list