[Spce-user] spce caller name peered with Asterisk/FreeSwitch
Vladimir Broz
vladiksip at centrum.cz
Sat Aug 20 16:45:11 EDT 2011
I do not think that's correct way. You are trying to replace the URI,
not the display name.
from the log you posted before:
INFO:<script>: Setting From to 'sip:"Testy Testerson"@ASTERISK_IP' -
>> M=INVITE
...
{
xlog("L_INFO", "Setting From to '$var(caller_cli_uri)' - M=$rm R=$ru
F=$fu T=$tu IP=$avp(s:ip):$avp(s:port) ($si:$sp) ID=$ci\n");
uac_replace_from("$var(caller_cli)", "$var(caller_cli_uri)");
}
the uac_replace_from function should do:
# replace both display and uri
uac_replace_from("$avp(s:display)","$avp(s:uri)");
# replace only display and do not touch uri
uac_replace_from("batman","");
# remove display and replace uri
uac_replace_from("","sip:robin at gotham.org");
# remove display and do not touch uri
uac_replace_from("","");
so I guess you should look at the first parameter "$var(caller_cli)".
But it is only my guess, I'm not familiar with kamailio config into
details, sorry.
My 2 cents,
-Vlada B
On 08/20/2011 10:35 PM, Skyler wrote:
>
> I think the name will have to be extracted from $fu in some way and
> placed into its own pvar. Then passed along with $fU where required
> because other parts of the script needs $fU like P-Asserted-Identity.
>
> just guessing here, will continue to play with this more.
>
>
> U 2011/08/20 16:21:00.479790 127.0.0.1:5062 -> 127.0.0.1:5080
> INVITE sip:b2b-16048881212 at DEVICE_IP:5060 SIP/2.0.
> Record-Route:
> <sip:127.0.0.1:5062;lr=on;ftag=as3718f22a;did=365.85f57a43;vsf=SlZ3eVwQEC81NzMXCB1iHHQgYggBETZ3RGtGflp3dhhDDUA2OA-->.
> Record-Route:<sip:127.0.0.1;r2=on;lr=on;ftag=as3718f22a>.
> Record-Route:<sip:SPCE_IP;r2=on;lr=on;ftag=as3718f22a>.
> Via: SIP/2.0/UDP
> 127.0.0.1:5062;branch=z9hG4bK334b.955d874cef855147ed506b3bbca0001f.0.
> Route:<sip:lb at 127.0.0.1:5060;lr>.
> Via: SIP/2.0/UDP 127.0.0.1;rport=5060;branch=z9hG4bK334b.648f3247.0.
> v: SIP/2.0/UDP ASTERISK_IP:5060;branch=z9hG4bK50a97a7b;rport=5060.
> Max-Forwards: 68.
> f: ""Testy Testerson""<sip:"Testy
> Testerson"@ASTERISK_IP>;tag=as3718f22a.
> t:<sip:16048881212 at SPCE_IP>.
> m:<sip:2274581515 at ASTERISK_IP>.
> i: 106aceff672c108717cb791207b6feb1 at ASTERISK_IP.
> CSeq: 102 INVITE.
> User-Agent: ASTERISK_UPSTREAM.
> Date: Sat, 20 Aug 2011 20:21:00 GMT.
> x: 600.
> Min-SE: 90.
> Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY,
> INFO.
> k: replaces, timer.
> c: application/sdp.
> l: 544.
> P-Asserted-Identity:<sip:"Testy Testerson"@ASTERISK_IP>.
> P-R-Uri: sip:16048881212 at DEVICE_IP:5060.
> P-D-Uri: sip:lb at 127.0.0.1:5060;lr
>
>
> On Sat, 2011-08-20 at 13:13 -0700, Skyler wrote:
>> Still looking to remove "" from the $fn pseudo var. I think this is good
>> start, next there may be extra<> also but one thing at a time I
>> guess :)
>>
>>
>> INFO:<script>: Setting From to 'sip:"Testy Testerson"@ASTERISK_IP' -
>> M=INVITE
>> <script>: NAT-Reply - S=400 - Bad From header F=<null>
>> T=sip:16048881212 at SPCE_IP
>> ERROR: pv [pv_core.c:418]: cannot parse From header
>> ERROR:<core> [parser/parse_from.c:79]: ERROR:parse_from_header: bad
>> from header
>> ERROR:<core> [parser/parse_to.c:737]: ERROR: parse_to : unexpected char
>> ["] in status 6:<<"Testy Testerson"<sip:>> .
>>
>>
>> On Sat, 2011-08-20 at 21:52 +0200, Vladimir Broz wrote:
>>>
>>> On 08/20/2011 09:51 PM, Vladimir Broz wrote:
>>>> especially if it is in proxy config, then it could be somewhere here:
>>>>
>>>> ...
>>>> if($fn != $null&& avp_check("$fn", "re/^\"?\+?[0-9]+\"?$"))
>>>> {
>>>> $avp(s:caller_cli_userprov) = $fn;
>>>> avp_subst("$avp(s:caller_cli_userprov)", "/^\"?([^\"]*)\"?$/\1/");
>>>> }
>>>> else
>>>> {
>>>> $avp(s:caller_cli_userprov) = $fU;
>>>> }
>>>> ....
>>>>
>>>> I guess (really my guess!!!), that the last line could be set to "$fn"...
>>>>
>>>> else
>>>> {
>>>> $avp(s:caller_cli_userprov) = $fU;
>>> $avp(s:caller_cli_userprov) = $fn;
>>>> }
>>> indeed...
>>>
>>> -Vlada B.
>>>>
>>>> I'm really not sure! and don't know SPCE in details, it may cause some
>>>> other problems...
>>>>
>>>> Sorry if I'm wrong!
>>>>
>>>> Regards,
>>>> -Vlada B.
>>>>
>>>> On 08/20/2011 09:42 PM, Vladimir Broz wrote:
>>>>> Hi,
>>>>>
>>>>> On 08/20/2011 08:40 PM, Skyler wrote:
>>>>>> Hi,
>>>>>>
>>>>>> My appologies. I missed the INVITE from spce proxy to sems. The missing
>>>>>> INVITE is below, this shows that the From HF is replace by proxy prior
>>>>>> to sending to sems. Now looking into proxy config ...
>>>>>
>>>>> try to find "$fn" which is the reference to display name in From
>>>>> header...
>>>>>
>>>>> -Vlada B.
>>>>>>
>>>>>>
>>>>>> U 2011/08/20 14:20:31.790504 127.0.0.1:5062 -> 127.0.0.1:5080
>>>>>> INVITE sip:b2b-16048881212 at DEVICE_IP:5060 SIP/2.0.
>>>>>> Record-Route:
>>>>>> <sip:127.0.0.1:5062;lr=on;ftag=as6c6ae522;did=982.3dde1881;vsf=SlZ3eUh2S29GYmhXTExOWVUzZk1KVnd5SHZLb0ZiaFdMTE4->.
>>>>>>
>>>>>>
>>>>>> Record-Route:<sip:127.0.0.1;r2=on;lr=on;ftag=as6c6ae522>.
>>>>>> Record-Route:<sip:SPCE_IP;r2=on;lr=on;ftag=as6c6ae522>.
>>>>>> Via: SIP/2.0/UDP
>>>>>> 127.0.0.1:5062;branch=z9hG4bK8513.86716cf040064692b88f0029bb3fc8c7.0.
>>>>>> Route:<sip:lb at 127.0.0.1:5060;lr>.
>>>>>> Via: SIP/2.0/UDP 127.0.0.1;rport=5060;branch=z9hG4bK8513.9dd8fe07.0.
>>>>>> v: SIP/2.0/UDP ASTERISK_IP:5060;branch=z9hG4bK3bb6032e;rport=5060.
>>>>>> Max-Forwards: 68.
>>>>>> f: "2725846431"<sip:2725846431 at ASTERISK_IP>;tag=as6c6ae522.
>>>>>> t:<sip:16048881212 at SPCE_IP>.
>>>>>> m:<sip:2725846431 at ASTERISK_IP>.
>>>>>> i: 7fc3bcbf5bf0e6ef19907a8d5dc0e179 at ASTERISK_IP.
>>>>>> CSeq: 102 INVITE.
>>>>>> User-Agent: voxcentral.
>>>>>> Date: Sat, 20 Aug 2011 18:20:31 GMT.
>>>>>> x: 600.
>>>>>> Min-SE: 90.
>>>>>> Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY,
>>>>>> INFO.
>>>>>> k: replaces, timer.
>>>>>> c: application/sdp.
>>>>>> l: 544.
>>>>>> P-Asserted-Identity:<sip:2725846431 at ASTERISK_IP>.
>>>>>> P-R-Uri: sip:16048881212 at DEVICE_IP:5060.
>>>>>> P-D-Uri: sip:lb at 127.0.0.1:5060;lr
>>>>>> .
>>>>>>
>>>>>> On Sat, 2011-08-20 at 01:51 -0700, Skyler wrote:
>>>>>>> Hi,
>>>>>>>
>>>>>>>>
>>>>>>>> I see. I'll check it out in our dev systems.
>>>>>>>>
>>>>>>>
>>>>>>> I can confirm that this is indeed an issue on the SPCE side of things
>>>>>>> (trace below). Notice how the caller name in from field is replaced in
>>>>>>> reply from SEMS? This is related to B2BUA functionality I think.
>>>>>>>
>>>>>>> Hope this helps out. I don't know anything about SEMS but wanting to
>>>>>>> fix
>>>>>>> this also so will be looking into it more over the weekend here.
>>>>>>>
>>>>>>> Cheers,
>>>>>>>
>>>>>>> S.
>>>>>>>
>>>>>>>
>>>>>>> U 2011/08/20 04:31:02.882004 ASTERISK_IP:5060 -> SPCE_IP:5060
>>>>>>> INVITE sip:16048881212 at SPCE_IP SIP/2.0.
>>>>>>> v: SIP/2.0/UDP ASTERISK_IP:5060;branch=z9hG4bK78bc993b;rport.
>>>>>>> Max-Forwards: 70.
>>>>>>> f: "Testy Testerson"<sip:2725846431 at ASTERISK_IP>;tag=as17b832a2.
>>>>>>> t:<sip:16048881212 at SPCE_IP>.
>>>>>>> m:<sip:2725846431 at ASTERISK_IP>.
>>>>>>> i: 470166fd32c0a2e840d226450f2ebd6c at ASTERISK_IP.
>>>>>>> CSeq: 102 INVITE.
>>>>>>> User-Agent: Asterisk (1.6.2).
>>>>>>> Date: Sat, 20 Aug 2011 08:31:02 GMT.
>>>>>>> x: 600.
>>>>>>> Min-SE: 90.
>>>>>>> Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY,
>>>>>>> INFO.
>>>>>>> k: replaces, timer.
>>>>>>> c: application/sdp.
>>>>>>> l: 524.
>>>>>>> .
>>>>>>> v=0.
>>>>>>> o=root 1615613317 1615613317 IN IP4 ASTERISK_IP.
>>>>>>> s=Asterisk (1.6.2).
>>>>>>> c=IN IP4 ASTERISK_IP.
>>>>>>> t=0 0.
>>>>>>> m=audio 15224 RTP/AVP 0 4 3 8 112 5 10 7 18 111 9 101.
>>>>>>> a=rtpmap:0 PCMU/8000.
>>>>>>> a=rtpmap:4 G723/8000.
>>>>>>> a=fmtp:4 annexa=no.
>>>>>>> a=rtpmap:3 GSM/8000.
>>>>>>> a=rtpmap:8 PCMA/8000.
>>>>>>> a=rtpmap:112 G726-32/8000.
>>>>>>> a=rtpmap:5 DVI4/8000.
>>>>>>> a=rtpmap:10 L16/8000.
>>>>>>> a=rtpmap:7 LPC/8000.
>>>>>>> a=rtpmap:18 G729/8000.
>>>>>>> a=fmtp:18 annexb=no.
>>>>>>> a=rtpmap:111 G726-32/8000.
>>>>>>> a=rtpmap:9 G722/8000.
>>>>>>> a=rtpmap:101 telephone-event/8000.
>>>>>>> a=fmtp:101 0-16.
>>>>>>> a=ptime:20.
>>>>>>> a=sendrecv.
>>>>>>>
>>>>>>> U 2011/08/20 04:31:02.882371 SPCE_IP:5060 -> ASTERISK_IP:5060
>>>>>>> SIP/2.0 100 Trying.
>>>>>>> v: SIP/2.0/UDP ASTERISK_IP:5060;branch=z9hG4bK78bc993b;rport=5060.
>>>>>>> f: "Testy Testerson"<sip:2725846431 at ASTERISK_IP>;tag=as17b832a2.
>>>>>>> t:<sip:16048881212 at SPCE_IP>.
>>>>>>> i: 470166fd32c0a2e840d226450f2ebd6c at ASTERISK_IP.
>>>>>>> CSeq: 102 INVITE.
>>>>>>> Server: kamailio (3.1.3 (x86_64/linux)).
>>>>>>> Content-Length: 0.
>>>>>>> .
>>>>>>>
>>>>>>> U 2011/08/20 04:31:02.882689 127.0.0.1:5060 -> 127.0.0.1:5062
>>>>>>> INVITE sip:16048881212 at SPCE_IP SIP/2.0.
>>>>>>> Record-Route:<sip:127.0.0.1;r2=on;lr=on;ftag=as17b832a2>.
>>>>>>> Record-Route:<sip:SPCE_IP;r2=on;lr=on;ftag=as17b832a2>.
>>>>>>> Via: SIP/2.0/UDP 127.0.0.1;branch=z9hG4bK9658.0d9f2ae1.0.
>>>>>>> v: SIP/2.0/UDP ASTERISK_IP:5060;branch=z9hG4bK78bc993b;rport=5060.
>>>>>>> Max-Forwards: 69.
>>>>>>> f: "Testy Testerson"<sip:2725846431 at ASTERISK_IP>;tag=as17b832a2.
>>>>>>> t:<sip:16048881212 at SPCE_IP>.
>>>>>>> m:<sip:2725846431 at ASTERISK_IP>.
>>>>>>> i: 470166fd32c0a2e840d226450f2ebd6c at ASTERISK_IP.
>>>>>>> CSeq: 102 INVITE.
>>>>>>> User-Agent: Asterisk (1.6.2).
>>>>>>> Date: Sat, 20 Aug 2011 08:31:02 GMT.
>>>>>>> x: 600.
>>>>>>> Min-SE: 90.
>>>>>>> Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY,
>>>>>>> INFO.
>>>>>>> k: replaces, timer.
>>>>>>> c: application/sdp.
>>>>>>> l: 524.
>>>>>>> P-NGCP-Src-Ip: ASTERISK_IP.
>>>>>>> P-NGCP-Src-Port: 5060.
>>>>>>> P-NGCP-Src-Proto: udp.
>>>>>>> .
>>>>>>> v=0.
>>>>>>> o=root 1615613317 1615613317 IN IP4 ASTERISK_IP.
>>>>>>> s=Asterisk (1.6.2).
>>>>>>> c=IN IP4 ASTERISK_IP.
>>>>>>> t=0 0.
>>>>>>> m=audio 15224 RTP/AVP 0 4 3 8 112 5 10 7 18 111 9 101.
>>>>>>> a=rtpmap:0 PCMU/8000.
>>>>>>> a=rtpmap:4 G723/8000.
>>>>>>> a=fmtp:4 annexa=no.
>>>>>>> a=rtpmap:3 GSM/8000.
>>>>>>> a=rtpmap:8 PCMA/8000.
>>>>>>> a=rtpmap:112 G726-32/8000.
>>>>>>> a=rtpmap:5 DVI4/8000.
>>>>>>> a=rtpmap:10 L16/8000.
>>>>>>> a=rtpmap:7 LPC/8000.
>>>>>>> a=rtpmap:18 G729/8000.
>>>>>>> a=fmtp:18 annexb=no.
>>>>>>> a=rtpmap:111 G726-32/8000.
>>>>>>> a=rtpmap:9 G722/8000.
>>>>>>> a=rtpmap:101 telephone-event/8000.
>>>>>>> a=fmtp:101 0-16.
>>>>>>> a=ptime:20.
>>>>>>> a=sendrecv.
>>>>>>>
>>>>>>> U 2011/08/20 04:31:02.882854 127.0.0.1:5062 -> 127.0.0.1:5060
>>>>>>> SIP/2.0 100 Trying.
>>>>>>> Via: SIP/2.0/UDP 127.0.0.1;branch=z9hG4bK9658.0d9f2ae1.0;rport=5060.
>>>>>>> v: SIP/2.0/UDP ASTERISK_IP:5060;branch=z9hG4bK78bc993b;rport=5060.
>>>>>>> f: "Testy Testerson"<sip:2725846431 at ASTERISK_IP>;tag=as17b832a2.
>>>>>>> t:<sip:16048881212 at SPCE_IP>.
>>>>>>> i: 470166fd32c0a2e840d226450f2ebd6c at ASTERISK_IP.
>>>>>>> CSeq: 102 INVITE.
>>>>>>> Server: kamailio (3.1.3 (x86_64/linux)).
>>>>>>> Content-Length: 0.
>>>>>>> .
>>>>>>>
>>>>>>> U 2011/08/20 04:31:02.956841 127.0.0.1:5080 -> 127.0.0.1:5060
>>>>>>> INVITE sip:b2b-16048881212 at 207.216.253.26:5060 SIP/2.0.
>>>>>>> Via: SIP/2.0/UDP 127.0.0.1:5080;branch=z9hG4bKQJ~PjayQ;rport.
>>>>>>> From: "2725846431"
>>>>>>> <sip:2725846431 at ASTERISK_IP>;tag=24AD3534-4E4F70C6000E9916-5C705700.
>>>>>>> To:<sip:16048881212 at SPCE_IP>.
>>>>>>> CSeq: 10 INVITE.
>>>>>>> Call-ID: 470166fd32c0a2e840d226450f2ebd6c at ASTERISK_IP_b2b-1.
>>>>>>> Contact:<sip:127.0.0.1:5080>.
>>>>>>> Route:<sip:lb at 127.0.0.1:5060;lr;lr>.
>>>>>>> P-Asserted-Identity:<sip:2725846431 at ASTERISK_IP>.
>>>>>>> P-R-Uri: sip:16048881212 at 207.216.253.26:5060.
>>>>>>> P-D-Uri: sip:lb at 127.0.0.1:5060;lr.
>>>>>>> Supported: timer.
>>>>>>> Session-Expires: 300.
>>>>>>> Min-SE: 90.
>>>>>>> Content-Type: application/sdp.
>>>>>>> Content-Length: 544.
>>>>>>> v=0.
>>>>>>> o=root 1615613317 1615613317 IN IP4 SPCE_IP.
>>>>>>> s=Asterisk (1.6.2).
>>>>>>> c=IN IP4 SPCE_IP.
>>>>>>> t=0 0.
>>>>>>> m=audio 30076 RTP/AVP 0 4 3 8 112 5 10 7 18 111 9 101.
>>>>>>> a=rtpmap:0 PCMU/8000.
>>>>>>> a=rtpmap:4 G723/8000.
>>>>>>> a=fmtp:4 annexa=no.
>>>>>>> a=rtpmap:3 GSM/8000.
>>>>>>> a=rtpmap:8 PCMA/8000.
>>>>>>> a=rtpmap:112 G726-32/8000.
>>>>>>> a=rtpmap:5 DVI4/8000.
>>>>>>> a=rtpmap:10 L16/8000.
>>>>>>> a=rtpmap:7 LPC/8000.
>>>>>>> a=rtpmap:18 G729/8000.
>>>>>>> a=fmtp:18 annexb=no.
>>>>>>> a=rtpmap:111 G726-32/8000.
>>>>>>> a=rtpmap:9 G722/8000.
>>>>>>> a=rtpmap:101 telephone-event/8000.
>>>>>>> a=fmtp:101 0-16.
>>>>>>> a=ptime:20.
>>>>>>> a=sendrecv.
>>>>>>> a=nortpproxy:yes.
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>> _______________________________________________
>>>>>> Spce-user mailing list
>>>>>> Spce-user at lists.sipwise.com
>>>>>> http://lists.sipwise.com/listinfo/spce-user
>>>>>
>>>>> _______________________________________________
>>>>> Spce-user mailing list
>>>>> Spce-user at lists.sipwise.com
>>>>> http://lists.sipwise.com/listinfo/spce-user
>>>>
>>>> _______________________________________________
>>>> Spce-user mailing list
>>>> Spce-user at lists.sipwise.com
>>>> http://lists.sipwise.com/listinfo/spce-user
>
More information about the Spce-user
mailing list