How to get SIP header info from VSP?


#1

Hello.
When I make an outbound call, my VSP sends me a specific ERROR code which is located within the “Reason:” field of a SIP packet header. I’d like to use this error code when making a routing decision. How can I write this error code into a variable?
When I try to do it like this:
exten => s,n,NoOp(Inserted for watching SIP_HEADERvar = ${SIP_HEADER(Reason)}),
I get nothing.

like this:
exten => s,n,NoOp(Inserted for watching SIP_HEADERvar = ${SIP_HEADER(From)})
I get an IP address of an extension making an outbound call, not a VSP peer one. Looks like SIP_HEADER doesn’t handle VSP peer information at all.
What’s wrong?


#2

Are You sure that the provider is delivering an explicit “Reason”-Header? If so it should be available using SIP_HEADER-function. As this doesn’t seems to be functional I guess that You just get back a status code from the provider. This status code will be stored by asterisk - beginning with version 1.8 - in variable SIP_CAUSE and could be used in the dialplaan for further decissions.


#3

Yes, I am, I definitely can see it in a SIP header.

Thank you. Have not heard about that.


#4

abw1oim, u r a Big Brain!
SIP_CAUSE works like a charm.
Thank you for ridding me of the numerous sleepless nights.


#5

[quote=“rusya_rr”]abw1oim, u r a Big Brain!
SIP_CAUSE works like a charm.
Thank you for ridding me of the numerous sleepless nights.[/quote]

Hello rusya_rr

  1. which asteris kversion do u have?
  2. did u configure it as:
    exten => s,n,NoOp(Inserted for watching SIP_HEADERvar = ${SIP_HEADER(sip_cause)}) ??
    did it work? please let us know as this is helpful for me.

#6

There is no such word as “u” in English.

What he is saying is that there is a channel variable containing this information, not that Asterisk is faking the presence of a SIP header of that name.


#7

[quote=“HusseinK”]1) which asteris kversion do u have?
2) did u configure it as:
exten => s,n,NoOp(Inserted for watching SIP_HEADERvar = ${SIP_HEADER(sip_cause)}) ??
did it work? please let us know as this is helpful for me.
[/quote]

  1. 1.8.5
  2. no. better read carefully here. This is exactly what I wanted to implement.
    And yeaah, it works. :smile:

[quote=“david55”]There is no such word as “u” in English.
[/quote]
Ok. Is there such a word - “Ok” in English? :smiley: