[Home]

Summary:ASTERISK-14089: [patch] Blank FORWARD_CONTEXT is not ignored
Reporter:Philippe Lindheimer (p_lindheimer)Labels:
Date Opened:2009-05-07 17:53:16Date Closed:2009-05-29 22:28:30
Priority:MinorRegression?No
Status:Closed/CompleteComponents:Applications/app_dial
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) 05292009_bug15056.diff
Description:Once you have set FORWARD_CONTEXT=some-context in your dialplan, it is not possible to "unset" the channel variable. Therefore the only way to unset it is to set it blank:

exten => exten,n,Set(FORWARD_CONTEXT=)

However this appears to result in Asterisk using a non-existent blank context for the forwarded call resulting in it failing.

Since there is no way to reset a context, I would expect this to treat a blank context as if the variable was not set.

****** STEPS TO REPRODUCE ******

1. Set the FORWARD_CONTEXT to an empty string
2. Forward a phone using device side forwarding
3. Call the phone through the above dialplan

the call fails.
Comments:By: Philippe Lindheimer (p_lindheimer) 2009-05-07 18:03:24

btw - If I am not mistaken, the TRANSFER_CONTEXT is handled correctly and may be reviewed.

By: Sean Bright (seanbright) 2009-05-29 09:46:32

Please test the attached patch.

By: Philippe Lindheimer (p_lindheimer) 2009-05-29 15:43:25

that does not seem to do the trick, here is the CLI results, as you can see, it forwards it to a non-existent context, Local/7361234

   -- Executing [s@macro-dial:7] Dial("SIP/222-b7921e50", "SIP/700|24|tTwWr") in new stack
   -- Called 700
   -- Got SIP response 302 "Moved Temporarily" back from 192.168.1.61
   -- Now forwarding SIP/222-b7921e50 to 'Local/7361234@' (thanks to SIP/700-08ff4ec0)

where as if FORWARD_CONTEXT were never set here is the results you get with a Noop inserted in the call flow to print out the FORWARD_CONTEXT to confirm it is not set to anyhting:

   -- Executing [445@from-internal:19] NoOp("SIP/222-b7922258", "FORWARD_CONTEXT VALUE IS: ") in new stack

...

   -- Executing [s@macro-dial:7] Dial("SIP/222-b7922258", "SIP/700|24|tTwWr") in new stack
   -- Called 700
   -- Got SIP response 302 "Moved Temporarily" back from 192.168.1.61
   -- Now forwarding SIP/222-b7922258 to 'Local/7361234@from-internal' (thanks to SIP/700-090a9968)

By: Sean Bright (seanbright) 2009-05-29 16:49:02

Not to ask a silly question, but you did do a make and make install after applying the patch, yes?

By: Philippe Lindheimer (p_lindheimer) 2009-05-29 17:35:24

oops - well I wasn't that silly, but I forgot to do a "restart now", sorry. It does work:)

By: Digium Subversion (svnbot) 2009-05-29 21:46:42

Repository: asterisk
Revision: 198251

U   branches/1.4/apps/app_dial.c

------------------------------------------------------------------------
r198251 | seanbright | 2009-05-29 21:46:42 -0500 (Fri, 29 May 2009) | 8 lines

Treat an empty FORWARD_CONTEXT the same way we treat a missing one.

(closes issue ASTERISK-14089)
Reported by: p_lindheimer
Patches:
     05292009_bug15056.diff uploaded by seanbright (license 71)
Tested by: p_lindheimer

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=198251

By: Digium Subversion (svnbot) 2009-05-29 22:26:07

Repository: asterisk
Revision: 198285

_U  trunk/
U   trunk/apps/app_dial.c

------------------------------------------------------------------------
r198285 | seanbright | 2009-05-29 22:26:07 -0500 (Fri, 29 May 2009) | 15 lines

Merged revisions 198251 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
 r198251 | seanbright | 2009-05-29 22:46:41 -0400 (Fri, 29 May 2009) | 8 lines
 
 Treat an empty FORWARD_CONTEXT the same way we treat a missing one.
 
 (closes issue ASTERISK-14089)
 Reported by: p_lindheimer
 Patches:
       05292009_bug15056.diff uploaded by seanbright (license 71)
 Tested by: p_lindheimer
........

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=198285

By: Digium Subversion (svnbot) 2009-05-29 22:27:32

Repository: asterisk
Revision: 198292

_U  branches/1.6.0/
U   branches/1.6.0/apps/app_dial.c

------------------------------------------------------------------------
r198292 | seanbright | 2009-05-29 22:27:31 -0500 (Fri, 29 May 2009) | 22 lines

Merged revisions 198285 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

................
 r198285 | seanbright | 2009-05-29 23:26:06 -0400 (Fri, 29 May 2009) | 15 lines
 
 Merged revisions 198251 via svnmerge from
 https://origsvn.digium.com/svn/asterisk/branches/1.4
 
 ........
   r198251 | seanbright | 2009-05-29 22:46:41 -0400 (Fri, 29 May 2009) | 8 lines
   
   Treat an empty FORWARD_CONTEXT the same way we treat a missing one.
   
   (closes issue ASTERISK-14089)
   Reported by: p_lindheimer
   Patches:
         05292009_bug15056.diff uploaded by seanbright (license 71)
   Tested by: p_lindheimer
 ........
................

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=198292

By: Digium Subversion (svnbot) 2009-05-29 22:28:06

Repository: asterisk
Revision: 198295

_U  branches/1.6.1/
U   branches/1.6.1/apps/app_dial.c

------------------------------------------------------------------------
r198295 | seanbright | 2009-05-29 22:28:06 -0500 (Fri, 29 May 2009) | 22 lines

Merged revisions 198285 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

................
 r198285 | seanbright | 2009-05-29 23:26:06 -0400 (Fri, 29 May 2009) | 15 lines
 
 Merged revisions 198251 via svnmerge from
 https://origsvn.digium.com/svn/asterisk/branches/1.4
 
 ........
   r198251 | seanbright | 2009-05-29 22:46:41 -0400 (Fri, 29 May 2009) | 8 lines
   
   Treat an empty FORWARD_CONTEXT the same way we treat a missing one.
   
   (closes issue ASTERISK-14089)
   Reported by: p_lindheimer
   Patches:
         05292009_bug15056.diff uploaded by seanbright (license 71)
   Tested by: p_lindheimer
 ........
................

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=198295

By: Digium Subversion (svnbot) 2009-05-29 22:28:29

Repository: asterisk
Revision: 198297

_U  branches/1.6.2/
U   branches/1.6.2/apps/app_dial.c

------------------------------------------------------------------------
r198297 | seanbright | 2009-05-29 22:28:29 -0500 (Fri, 29 May 2009) | 22 lines

Merged revisions 198285 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

................
 r198285 | seanbright | 2009-05-29 23:26:06 -0400 (Fri, 29 May 2009) | 15 lines
 
 Merged revisions 198251 via svnmerge from
 https://origsvn.digium.com/svn/asterisk/branches/1.4
 
 ........
   r198251 | seanbright | 2009-05-29 22:46:41 -0400 (Fri, 29 May 2009) | 8 lines
   
   Treat an empty FORWARD_CONTEXT the same way we treat a missing one.
   
   (closes issue ASTERISK-14089)
   Reported by: p_lindheimer
   Patches:
         05292009_bug15056.diff uploaded by seanbright (license 71)
   Tested by: p_lindheimer
 ........
................

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=198297