[asterisk-bugs] [JIRA] (ASTERISK-24795) When a call is dialed using a gosub to a different context using the switch/goto statement and the call is parked, recovering the call gives a wrong callerid

Leandro Dardini (JIRA) noreply at issues.asterisk.org
Sun Mar 29 03:25:34 CDT 2015


    [ https://issues.asterisk.org/jira/browse/ASTERISK-24795?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=225688#comment-225688 ] 

Leandro Dardini edited comment on ASTERISK-24795 at 3/29/15 3:24 AM:
---------------------------------------------------------------------

I have managed to "export" the config from AEL to .conf, by running a "dialplan show" and then translating the output to a valid .conf configuration:

{code}
[authenticated]
exten => *7,1,Park()                                     
exten => *8,1,ParkedCall()                               
exten => 104,1,gosub(doDialing,104,1)                     

[doDialing]
exten => sw_24463_,10, Goto(sw_24463_.,10)                       
exten => sw_24463_1,10, NoOp(one)                                 
exten => sw_24463_1,11, Goto(_X.,4)                               
exten => sw_24463_2,10, NoOp(two)                                 
exten => sw_24463_2,11, Goto(_X.,4)                               
exten => sw_24463_3,10, NoOp(three)                               
exten => sw_24463_3,11, Goto(_X.,4)                               
exten => sw_24463_4,10, NoOp(four)                                
exten => sw_24463_4,11, Goto(_X.,4)                               
exten => sw_24463_5,10, NoOp(five)                                
exten => sw_24463_5,11, Goto(_X.,4)                               
exten => _sw_24463_.,10, Goto(_X.,4)                               
exten => _X.,1, MSet(~~EXTEN~~=${EXTEN})                   
exten => _X.,2, Set(a=5)                                   
exten => _X.,3, Goto(sw_24463_${a},10)                     
exten => _X.,4, NoOp(Finish switch_doDialing_24463)        
exten => _X.,5, Dial(SIP/onlytest/998474638374)         
{code}

The result is the same, the callerID of the call coming out of the parking lot is _X.

I tried removing the MSet(~~EXTEN~~=${EXTEN}) that seems useless, but the problem happens the same.

I tried adding a exten => _X.,1,Set(CALLERID(num)=110) in place, but the problem happens the same, like if for parking lot callerID a different "internal stored" callerID is used.

If I try to dump all channel variables with exten => _X.,1, DumpChan(1)

I do not find the callerID then used as parking lot callerID, but it still pops out when recovering the call.

{quote}
 Dumping Info For Channel: SIP/110-DEVEL-0000000c:
 ================================================================================
 Info:
 Name=               SIP/110-DEVEL-0000000c
 Type=               SIP
 UniqueID=           srv01-1427617137.42
 LinkedID=           srv01-1427617137.42
 CallerIDNum=        110
 CallerIDName=       Thomas Tran
 ConnectedLineIDNum= (N/A)
 ConnectedLineIDName=(N/A)
 DNIDDigits=         104
 RDNIS=              (N/A)
 Parkinglot=         DEVEL
 Language=           en
 State=              Ring (4)
 Rings=              0
 NativeFormat=       (g729)
 WriteFormat=        g729
 ReadFormat=         g729
 RawWriteFormat=     g729
 RawReadFormat=      g729
 WriteTranscode=     No
 ReadTranscode=      No
 1stFileDescriptor=  35
 Framesin=           0
 Framesout=          0
 TimetoHangup=       0
 ElapsedTime=        0h0m0s
 BridgeID=           (Not bridged)
 Context=            doDialing
 Extension=          104
 Priority=           1
 CallGroup=
 PickupGroup=
 Application=        DumpChan
 Data=               1
 Blocking_in=        (Not Blocking)

 Variables:
 ARGC=0
 SIPCALLID=bdd49da0-d73115af at 192.168.2.16
 SIPDOMAIN=demo.mirtapbx.com
 SIPURI=sip:110-DEVEL at 192.168.2.16:5062
{quote}


was (Author: ldardini):
I have managed to "export" the config from AEL to .conf, by running a "dialplan show" and then translating the output to a valid .conf configuration:

{quote}
[authenticated]
exten => *7,1,Park()                                     
exten => *8,1,ParkedCall()                               
exten => 104,1,gosub(doDialing,104,1)                     

[doDialing]
exten => sw_24463_,10, Goto(sw_24463_.,10)                       
exten => sw_24463_1,10, NoOp(one)                                 
exten => sw_24463_1,11, Goto(_X.,4)                               
exten => sw_24463_2,10, NoOp(two)                                 
exten => sw_24463_2,11, Goto(_X.,4)                               
exten => sw_24463_3,10, NoOp(three)                               
exten => sw_24463_3,11, Goto(_X.,4)                               
exten => sw_24463_4,10, NoOp(four)                                
exten => sw_24463_4,11, Goto(_X.,4)                               
exten => sw_24463_5,10, NoOp(five)                                
exten => sw_24463_5,11, Goto(_X.,4)                               
exten => _sw_24463_.,10, Goto(_X.,4)                               
exten => _X.,1, MSet(~~EXTEN~~=${EXTEN})                   
exten => _X.,2, Set(a=5)                                   
exten => _X.,3, Goto(sw_24463_${a},10)                     
exten => _X.,4, NoOp(Finish switch_doDialing_24463)        
exten => _X.,5, Dial(SIP/onlytest/998474638374)         
{quote}

The result is the same, the callerID of the call coming out of the parking lot is _X.

I tried removing the MSet(~~EXTEN~~=${EXTEN}) that seems useless, but the problem happens the same.

I tried adding a exten => _X.,1,Set(CALLERID(num)=110) in place, but the problem happens the same, like if for parking lot callerID a different "internal stored" callerID is used.

If I try to dump all channel variables with exten => _X.,1, DumpChan(1)

I do not find the callerID then used as parking lot callerID, but it still pops out when recovering the call.

{quote}
 Dumping Info For Channel: SIP/110-DEVEL-0000000c:
 ================================================================================
 Info:
 Name=               SIP/110-DEVEL-0000000c
 Type=               SIP
 UniqueID=           srv01-1427617137.42
 LinkedID=           srv01-1427617137.42
 CallerIDNum=        110
 CallerIDName=       Thomas Tran
 ConnectedLineIDNum= (N/A)
 ConnectedLineIDName=(N/A)
 DNIDDigits=         104
 RDNIS=              (N/A)
 Parkinglot=         DEVEL
 Language=           en
 State=              Ring (4)
 Rings=              0
 NativeFormat=       (g729)
 WriteFormat=        g729
 ReadFormat=         g729
 RawWriteFormat=     g729
 RawReadFormat=      g729
 WriteTranscode=     No
 ReadTranscode=      No
 1stFileDescriptor=  35
 Framesin=           0
 Framesout=          0
 TimetoHangup=       0
 ElapsedTime=        0h0m0s
 BridgeID=           (Not bridged)
 Context=            doDialing
 Extension=          104
 Priority=           1
 CallGroup=
 PickupGroup=
 Application=        DumpChan
 Data=               1
 Blocking_in=        (Not Blocking)

 Variables:
 ARGC=0
 SIPCALLID=bdd49da0-d73115af at 192.168.2.16
 SIPDOMAIN=demo.mirtapbx.com
 SIPURI=sip:110-DEVEL at 192.168.2.16:5062
{quote}

> When a call is dialed using a gosub to a different context using the switch/goto statement and the call is parked, recovering the call gives a wrong callerid
> -------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: ASTERISK-24795
>                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-24795
>             Project: Asterisk
>          Issue Type: Bug
>      Security Level: None
>          Components: PBX/pbx_ael, Resources/res_parking
>    Affects Versions: 11.12.0, 12.8.1, 13.2.0
>         Environment: CentOS 6 64 bit
>            Reporter: Leandro Dardini
>            Assignee: Rusty Newton
>            Severity: Minor
>         Attachments: fulldebug
>
>
> Using AEL language, If an extension calls a number XXX and then park the call, the number XXX being dialed is saved in the parking lot. When the call parked is recovered, the number XXX is transmitted to the calling extension using RPID. If the extension calls the number using a context reached using a gosub and in that context a switch statement is used, the number XXX is lost and being replaced by internal dialplan data, like SW_549_SIP or _X.
> Probably the application breaking the RPID is the "Goto".
> This bad behavior can be tested using this minimal diaplan:
> {code}
> context doDialing {
>         _X. => {
>             Set(a=5);
>             switch (${a}) {
>               case 1: NoOp(one);
>                    break;
>               case 2: NoOp(two);
>                    break;
>               case 3: NoOp(three);
>                    break;
>               case 4: NoOp(four);
>                    break;
>               case 5: NoOp(five);
>                        break;
>             }
>             Dial(SIP/onlytest/998474638374);
>         }
> }
> context internal {
>     104 => {
>        gosub(doDialing,104,1);
>     } 
>     *7 => {
>         Park();
>     }
>  
>     *8 => {
>         ParkedCall();
>     }
> }
> {code}
> And dialing from an extension in the "internal" context the number 104, then transferring to *7 and then recovering the call with *8
> This is the output of the CLI during the call:
> {code}
>     -- Executing [104 at authenticated:1] Gosub("SIP/110-DEVEL-00000016", "doDialing,104,1") in new stack
>     -- Executing [104 at doDialing:1] MSet("SIP/110-DEVEL-00000016", "~~EXTEN~~=104") in new stack
>     -- Executing [104 at doDialing:2] Set("SIP/110-DEVEL-00000016", "a=5") in new stack
>     -- Executing [104 at doDialing:3] Goto("SIP/110-DEVEL-00000016", "sw_4335_5,10") in new stack
>     -- Goto (doDialing,sw_4335_5,10)
>     -- Executing [sw_4335_5 at doDialing:10] NoOp("SIP/110-DEVEL-00000016", "five") in new stack
>     -- Executing [sw_4335_5 at doDialing:11] Goto("SIP/110-DEVEL-00000016", "_X.,4") in new stack
>     -- Goto (doDialing,_X.,4)
>     -- Executing [_X. at doDialing:4] NoOp("SIP/110-DEVEL-00000016", "Finish switch_doDialing_4335") in new stack
>     -- Executing [_X. at doDialing:5] Dial("SIP/110-DEVEL-00000016", "SIP/onlytest/998474638374") in new stack
> {code}
> When getting back the call with *8 the callerid connected appears to be "_X.". 
> This doesn't happen if the call is made without using the switch/goto statement. This doesn't happen if the call is made without using the gosub. This doesn't happen if the dialed number transmit RPID once reconnected.



--
This message was sent by Atlassian JIRA
(v6.2#6252)



More information about the asterisk-bugs mailing list