cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
25443
Views
15
Helpful
22
Replies

Modify SIP-Header P-Asserted-Identity

Michael Schmidt
Level 1
Level 1

Hi,

I just have a problem to modify the "P-Asserted-Identity" as the provider expect a special value.

The "normal" unmodified P-Asserted-Identity looks like this

P-Asserted-Identity: "username" <sip:XXXX77@x.x.x.x>

I want to change this P-Asserted-Identity to this one

P-Asserted-Identity: "username"<sip:YYYYYYYY77@y.y.y.y:5060>

X = internal DN
x = internal IP of CUCM
Y = external DN
y = external IP

I tried to do this with this config

voice class sip-profiles 1
request ANY sip-header P-Asserted-Identity modify "P-Asserted-Identity:(.*)<sip:XXXX77@x.x.x.x>" "P-Asserted-Identity:\1<sip:YYYYYYYY77@y.y.y.y:5060>"

dial-peer voice 11 voip
 description SIP-Outgoing
 translation-profile incoming SipInbound
 translation-profile outgoing SipOutbound
 destination-pattern 0T
 modem passthrough nse codec g711alaw
 session protocol sipv2
 session target ipv4:y.y.y.y
 session transport udp
 voice-class sip early-offer forced
 voice-class sip profiles 1
 dtmf-relay sip-notify rtp-nte
 codec g711alaw
 fax-relay ecm disable
 fax-relay sg3-to-g3
 fax nsf 000000
 fax protocol t38 version 0 ls-redundancy 0 hs-redundancy 0 fallback pass-through g711alaw
 no vad
!


In the log I also see that dialpeer 11 should be used:


*Jun 16 15:16:31.242 MESZ: //-1/xxxxxxxxxxxx/DPM/MatchNextPeer:
   Result=Success(0); Outgoing Dial-peer=11 Is Matched

But the problem is that the P-Asserted-Identity is not modified and still the default value.

What did I wrong?

BR
Michael

1 Accepted Solution

Accepted Solutions

ok, great

If the answers were useful please mark them as correct so we can consider this subject closed.

Leszek

View solution in original post

22 Replies 22

Jonathan Schulenberg
Hall of Fame
Hall of Fame

Sometimes the debug dialpeer output is challenging to read. Did you confirm that the call was actually connected using PID:11 on the outbound call leg using show call active voice brief?

Assuming that's a yes, I agee with Leszek that it looks good syntactically; however, you did specify the request. You may want to add a second line to the profile for response.

voice class sip-profiles 1
request ANY sip-header P-Asserted-Identity modify "P-Asserted-Identity:(.*)<sip:XXXX77@x.x.x.x>" "P-Asserted-Identity:\1<sip:YYYYYYYY77@y.y.y.y:5060>"
response ANY sip-header P-Asserted-Identity modify "P-Asserted-Identity:(.*)<sip:XXXX77@x.x.x.x>" "P-Asserted-Identity:\1<sip:YYYYYYYY77@y.y.y.y:5060>"

For example, the 1XX messages (e.g. 180 Ringing or 183 Session Progress) are responses, not a request. Same story for the 200 OK and ACK messages, all of which are the most common places for PAI to be communicated by CUCM (1XX is alerting while 200 is connected party information).

Leszek Wojnarski
Cisco Employee
Cisco Employee

Hi Michael,

I've been testing your script using this tool:

http://sip-profile.54.227.241.219.xip.io/

And for me all looks good (see the screenshot):

It might be a good idea to run "debug ccsip all" as this should debug also the script part and we should see why it's not applied.

Leszek

Hi Leszek,

Hi Jonathan,

thanks for your answers. I will have a look at this and reply to you.

@Leszek: I tried to open you mentioned test tool at "http://sip-profile.54.227.241.219.xip.io/sip-profiles.cgi" but the link is not working for me.

BR

Michael

Hi Jonathan,

the output for show call active voice brief looks like this:

Total call-legs: 2
0    : 12503 125141090ms.1 (*20:47:49.405 MESZ Fri Jun 17 2016) +23730 pid:100 Answer XXXX77 active
 dur 00:00:04 tx:67/10100 rx:725/116000 dscp:0 media:0 audio tos:0xB8 video tos:0x0
 IP 10.40.40.41:31106 SRTP: off rtt:0ms pl:0/0ms lost:0/0/0 delay:0/0/0ms g711alaw TextRelay: off Transcoded: No ICE: Off
 media inactive detected:n media contrl rcvd:n/a timestamp:n/a
 long duration call detected:n long duration call duration:n/a timestamp:n/a
 LostPacketRate:0.00 OutOfOrderRate:0.00

0    : 12504 125141100ms.1 (*20:47:49.415 MESZ Fri Jun 17 2016) +23710 pid:11 Originate EXTERNAL_PHONE_NUMBER active
 dur 00:00:04 tx:725/116000 rx:109/16510 dscp:0 media:0 audio tos:0xB8 video tos:0x0
 IP 10.15.165.102:17022 SRTP: off rtt:0ms pl:0/0ms lost:0/0/0 delay:0/0/0ms g711alaw TextRelay: off Transcoded: No ICE: Off
 media inactive detected:n media contrl rcvd:n/a timestamp:n/a
 long duration call detected:n long duration call duration:n/a timestamp:n/a
 LostPacketRate:0.00 OutOfOrderRate:0.00

BR

Michael

Michael,

Here is the correct link:

http://sip-profile.54.227.241.219.xip.io/

I've also updated in the previous post.

Leszek

Hi Leszek,

thank you.

In the test tool everything looks fine when I input:

SIP-Profile:

request ANY sip-header P-Asserted-Identity modify "P-Asserted-Identity:(.*)<sip:XXXX77@x.x.x.x>" "P-Asserted-Identity:\1<sip:YYYYYYY77@y.y.y.y:5060>"

Input Message:

INVITE sip:0049123456789@a.b.c.d:5060 SIP/2.0
Via: SIP/2.0/TCP x.x.x.x:5060;branch=z9hG4bK586c875fd7d71
From: "CANCOM" <sip:XXXX77@x.x.x.x>;tag=1007421~bf696554-d8b2-48cf-bd09-1508ef59b52b-58497736
To: <sip:0049123456789@a.b.c.d>
Date: Fri, 17 Jun 2016 18:43:04 GMT
Call-ID: 51ef7180-764144b8-519c9-2928280a@10.40.40.41
Supported: 100rel,timer,resource-priority,replaces
Min-SE: 1800
User-Agent: Cisco-CUCM10.5
Allow: INVITE, OPTIONS, INFO, BYE, CANCEL, ACK, PRACK, UPDATE, REFER, SUBSCRIBE, NOTIFY
CSeq: 101 INVITE
Expires: 180
Allow-Events: presence, kpml
Supported: X-cisco-srtp-fallback,X-cisco-original-called
Call-Info: <sip:x.x.x.x:5060>;method="NOTIFY;Event=telephone-event;Duration=500"
Cisco-Guid: 1374646656-0000065536-0000000240-0690497546
Session-Expires: 1800
P-Asserted-Identity: "username" <sip:XXXX77@x.x.x.x>
Remote-Party-ID: "username" <sip:XXXX77@x.x.x.x>;party=calling;screen=yes;privacy=off
Contact: <sip:XXXX77@x.x.x.x:5060;transport=tcp>
Max-Forwards: 70
Content-Type: application/sdp
Content-Length: 201

Output Message

P-Asserted-Identity: "username" <sip:YYYYYYYY77@y.y.y.y:5060>

But I don`t know why it`s not working at the router when calling.

BR

Michael

Michael,

You can collect "debug ccsip all" those debugs should capture the information of why the profile is not applied.

Leszek

Hi Leszek,

deb ccsip all is "not working" for that router because when I enable this debug I can`t manage the router anymore because the ping will increase up to over 2000 ms.

Is there any other ccsip debug like ccsip calls / messages ... to see the fault?

BR

Michael

Hi Leszek,

in the attachment please find the log for

deb voip ccapi inout

deb ccsip calls

deb ccsip messages

deb ccsip error

BR

Michael

Michael,

From what I can see PAI is not send on the outoging dial-peer to ITSP. Can you please add the command:

voice-class sip asserted-id pai

On the outgoing dial-peer. If it still doesn't work, please attach same set of traces with the command applied.

Leszek

Hi Leszek,

after adding this command to the outgoing dial-peer no outgoing calls are working anymore although I resetted the SIP trunk.

Could this be maybe because the provider disabled the "P-Asserted-Identity" query so we can call outside without the correct "P-Asserted-Identity"?

The "P-Asserted-Identity" also was not changed after adding this command:

P-Asserted-Identity: "username" <sip:XXXX77@x.x.x.x>

In the attachment the log from an unsuccesfull outgoing call.

BR

Michael

This time it was actually send. You can see different PAI is received and different is send. But ITSP is rejecting call because of invalid PAI. Not sure why is that they'd need to tell why do they do it. Would be good to check, I think it might be because of tel instead of sip.  But would be good to check with them so we can modify it in the right way.

*Jun 20 15:22:40.470 MESZ: //-1/xxxxxxxxxxxx/SIP/Msg/ccsipDisplayMsg:
Received:
INVITE sip:0049123456789@a.b.c.c:5060 SIP/2.0

Session-Expires: 1800
P-Asserted-Identity: "username" <sip:XXXX77@x.x.x.x>


*Jun 20 15:22:40.486 MESZ: //36351/610836800000/SIP/Msg/ccsipDisplayMsg:
Sent:
INVITE sip:0049123456789@y.y.y.y:5060 SIP/2.0
[...]
Max-Forwards: 69
P-Asserted-Identity: "username" <tel:YYYYYYYY77@a.b.c.c>
[...]


SIP: (36351) Group (a= group line) attribute, level 65535 instance 1 not found.
*Jun 20 15:22:41.170 MESZ: //36351/610836800000/SIP/Msg/ccsipDisplayMsg:
Received:
SIP/2.0 400 Invalid P-Asserted-Identity

Leszek

Hi Leszek,

many thanks for explanation.

You`re right.

They already told me how the P-Asserted-Identity should look like:

P-asserted should be exactly like this: P-Asserted-Identity: "xxxxxxx"<sip:YYYYYYYYY77@y.y.y.y:5060>

So actuall there are two problem <tel: have to be changed to <sip: and after the IP the Port :5060 is missing.

My rules actuall looks like this so normally <sip: don`t have to change to <tel: and I also have the port 5060 in the rule:

 request ANY sip-header P-Asserted-Identity modify "P-Asserted-Identity:(.*)<sip:XXXX77@x.x.x.x>" "P-Asserted-Identity:\1<sip:YYYYYYYY77@y.y.y.y:5060>"
response ANY sip-header P-Asserted-Identity modify "P-Asserted-Identity:(.*)<sip:XXXX77@x.x.x.x>" "P-Asserted-Identity:\1<sip:YYYYYYYY77@y.y.y.y:5060>"