[asterisk-dev] [Code Review] Add Connected line interception macros to Asterisk

Mark Michelson mmichelson at digium.com
Mon Jun 1 13:48:56 CDT 2009


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://reviewboard.digium.com/r/256/
-----------------------------------------------------------

(Updated 2009-06-01 13:48:56.659641)


Review request for Asterisk Developers.


Changes
-------

Addressed Russell's comments. Re-tested to be sure that the interception macros were called properly.


Summary
-------

Connected line reception and transmission is a new feature in Asterisk trunk. One of its shortcomings is the inability to modify received connected line information while a dialplan application is running. 

Here is a common example where this may be useful. Many office environments require that a digit (such as '9') is dialled in order to reach the PSTN. The problem is that when one dials a PSTN number, the information received from the far end will not have this prefix digit. To make the lives of users easier, it would be really nice if the prefix digit could be displayed for them.

This proposed patch adds the ability to add connected line interception macros into the dialplan. When we are going to send a connected line update to someone, the administrator has the ability to run a macro which can do whatever manipulation of connected line information is necessary to appease everyone. There are four defined macros in the channelvariables.tex file.

${CONNECTED_LINE_SEND_CALLEE_MACRO}        Macro to call before sending a connected line update to the callee
${CONNECTED_LINE_SEND_CALLEE_MACRO_ARGS}   Arguments to pass to ${CONNECTED_LINE_SEND_CALLEE_MACRO}
${CONNECTED_LINE_SEND_CALLER_MACRO}        Macro to call before sending a connected line update to the caller
${CONNECTED_LINE_SEND_CALLER_MACRO_ARGS}   Arguments to pass to ${CONNECTED_LINE_SEND_CALLER_MACRO}

So in the example I gave above, the administrator could write a simple macro like this:

[macro-addnine]
exten => s,1,Set(CONNECTEDLINE(num,i)=9${CONNECTEDLINE(num)}); Adds '9' to the connected line number

Then, he could add a priority before any Dial to the PSTN:
exten => blah,n,Set(CONNECTED_LINE_SEND_CALLER_MACRO=addnine)

Simple as that! And of course, one is not limited to modifying just the connected line number. You could modify the name, or even information not relating to connected line information.

Please review my code and see if there is anything that needs fixing. I realize as I am typing this that I have not placed anything in the CHANGES file, so I need to do that soon.i


Diffs (updated)
-----

  /trunk/apps/app_dial.c 198559 
  /trunk/apps/app_directed_pickup.c 198559 
  /trunk/apps/app_macro.c 198559 
  /trunk/apps/app_queue.c 198559 
  /trunk/channels/chan_sip.c 198559 
  /trunk/doc/tex/channelvariables.tex 198559 
  /trunk/include/asterisk/app.h 198559 
  /trunk/include/asterisk/channel.h 198559 
  /trunk/main/app.c 198559 
  /trunk/main/channel.c 198559 
  /trunk/main/dial.c 198559 
  /trunk/main/features.c 198559 

Diff: http://reviewboard.digium.com/r/256/diff


Testing
-------

I have tested this with a scenario similar to what I listed above. In addition, I tested features such as call pickup (both using the Pickup application and the pickupexten from features.conf), built-in blind and attended transfers, and SIP transfers.


Thanks,

Mark




More information about the asterisk-dev mailing list