P-Preferred-Identity

Get help with installing, upgrading and running Asterisk.

Moderators: muppetmaster, Moderator, Support

P-Preferred-Identity

Postby waldo_pepper » Sun Dec 16, 2012 9:36 am

Hello everybody,
for 2 days I'm testing this phrase in extension.conf:

exten => _0XXX.,1,Set(status=${DEVICE_STATE(DAHDI/G1)})
exten => _0XXX.,n,NoOp(SIP/status 2 has state ${status})


exten => _0XXX.,n,GotoIf("$(status}" = "unknown"]?SIP1:ISDN1)

exten => _0XXX.,n(ISDN1),Set(status="busy")
exten => _0XXX.,n,Dial(DAHDI/G1/${EXTEN},,r,)
exten => _0XXX.,n,Hangup()

exten => _0XXX.,n(SIP1),SipAddHeader(P-Preferred-Identity:<sip:49XXXXXXX@sipconnect.sipgate.de>))
exten => _0XXX.,n,Dial(SIP/${EXTEN}@sipconnect.sipgate.de,,r,)

exten => _0XXX.,n,Hangup()

This is Asterisk telling:

-- Executing [0XXXXXXXXXXX@intern:7] SIPAddHeader("SIP/50-00000000", "P-Preferred-Identity:<sip:49XXXXXXXXXXX@sipconnect.sipgate.de>)") in new stack
-- Executing [0XXXXXXXXXXX@intern:8] Dial("SIP/50-00000000", "SIP/0XXXXXXXXXXX@sipconnect.sipgate.de,,r,") in new stack
== Using SIP RTP CoS mark 5
-- Called SIP/0XXXXXXXXXXX@sipconnect.sipgate.de
-- SIP/sipconnect.sipgate.de-00000001 is making progress passing it to SIP/50-00000000
-- SIP/sipconnect.sipgate.de-00000001 is ringing


My Asterisk 1.8 is connected via a Sangoma B700 to ISDN and also to a VOIP Trunk.
I succeed to dial out without any problem in a simple DIAL(), also with changed dialout number. But using the gotoif()-function, I'm not able to change the dialout number.
Who knows a solution?
Regards
Waldo
waldo_pepper
Newsterisk
 
Posts: 4
Joined: Sun Dec 16, 2012 9:23 am

Re: P-Preferred-Identity

Postby david55 » Sun Dec 16, 2012 10:15 am

Missing "$[". ALso, an explanation of how it is supposed to work would have been useful.
david55
Moves Like Spencer
 
Posts: 10745
Joined: Fri Sep 26, 2008 5:03 am

Re: P-Preferred-Identity

Postby waldo_pepper » Sun Dec 16, 2012 10:37 am

@David55:
Thanks for reply!
I checked the $[ . In fact there should be a ) instead of a ] at the end of the phrase.
The result is the same.
"SipAddHeader(P-Preferred-Identity:<sip:49XXXXXXX@sipconnect.sipgate.de" isn't working correct!
waldo_pepper
Newsterisk
 
Posts: 4
Joined: Sun Dec 16, 2012 9:23 am

Re: P-Preferred-Identity

Postby david55 » Sun Dec 16, 2012 11:07 am

exten => _0XXX.,n,GotoIf($["$(status}" = "unknown"]?SIP1:ISDN1)

I thought you originally said that adding the header worked and had the desired effect and that it was the Goto that didn't work.

As I've never heard of that header before (Remote-Party-ID, which is uspported natively, and P-Asserted-Identity are used for caler-ID when From: is used for other purposes).
david55
Moves Like Spencer
 
Posts: 10745
Joined: Fri Sep 26, 2008 5:03 am

Re: P-Preferred-Identity

Postby waldo_pepper » Sun Dec 16, 2012 12:12 pm

Hi David55,
Sending the header with a normal DIAL() command out of extensions.conf is working fine, but if I try to do this after a gotoif() command, it fails!
waldo_pepper
Newsterisk
 
Posts: 4
Joined: Sun Dec 16, 2012 9:23 am

Re: P-Preferred-Identity

Postby waldo_pepper » Mon Dec 17, 2012 4:31 am

Hello everybody,
I found the solution of this problem:
the SIP provider gave a wrong information!
The right way to use SipAddHeader is: SIPAddHeader("SIP/50-00000000", "P-Preferred-Identity:sip:49XXXXXXXXXXX@sipconnect.sipgate.de)")
Without < >!
Regards
Waldo
waldo_pepper
Newsterisk
 
Posts: 4
Joined: Sun Dec 16, 2012 9:23 am


Return to Asterisk Support

Who is online

Users browsing this forum: Google [Bot], Yahoo [Bot] and 21 guests