It's funny Robert would come looking for this tonight, as I've been spending a 
fair amount of time trying to track this down today.  I then went to the source 
and found what Andreas had found below.
 
However, I'm not a real programmer, but just a hack of a hack....I tried to 
make my own variable but failed because I don't really know what the hell I'm 
doing! :D
 
Here's one form of what I tried, though I did try lots of different ways, but 
wasn't able to get it to compile without errors.  At best I got the server to 
do nothing, at worse I crashed the server when trying to use it:
 
pbx_builtin_setvar_helper(owner, "SIPRESPONSE", resp)
 
I tried this on lines 12375 & 12546 in version 1.4.4 chan_sip.c.
 
If someone who knows what the hell they are doing could tell me the correct 
variable for owner and if a simple (char)resp will function as it appears it 
wants a character not an integer, I would be ever so grateful.
 
Thanks,
Ken

________________________________

From: [EMAIL PROTECTED] on behalf of Andreas van dem Helge
Sent: Wed 5/16/2007 7:03 PM
To: Asterisk Users Mailing List - Non-Commercial Discussion
Subject: Re: [asterisk-users] Get sip response code



On 5/16/07, Robert Lister <[EMAIL PROTECTED]> wrote:
>
> I was wondering if it is possible (in 1.2.x) to get the SIP response code
> back after doing Dial().
>
> Dial() seems to treat most call-setup problems as dialstatus CONGESTION, and
> some are NOANSWER, but I want to know the SIP response code, so I could
> return the right tones to the user, not just a congestion tone for every
> fault.
>
> Anyone know a way to find out that information, so I want the "604" out of 
> this lot:

vim chan_sip.c
/Got SIP response

(Hint: there are a few references, they start around line 10.000)


> Or where do I need to look to find a SIP response code -> DIALSTATUS mapping?
> Are these configurable anywhere or are they hardcoded?

In app_dial.c all it does is:

                        pbx_builtin_setvar_helper(chan, "DIALSTATUS", status);

It shouldn't be too hard to add another variable for SIPDIALSTATUS or
whatever name you fancy.

> If I push the response code back to the handset (Cisco 7960) then it is even
> more unhelpful as it uses the same error message for all SIP error type
> response codes: "Reorder" but does not tell you why the call failed to set
> up. If it actually put the SIP response error on the display, that would be
> good, but it doesn't. (at least SIP 8.6 and prior software versions)
>

That seems like a bug you should address with the vendor.
_______________________________________________
--Bandwidth and Colocation provided by Easynews.com --

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


<<winmail.dat>>

_______________________________________________
--Bandwidth and Colocation provided by Easynews.com --

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Reply via email to