[Asterisk-Users] Fwd: can modify CHAN_SIP.c to generate a new exten=> ext, 2, dial(tech/peer) ?

陈帆 jeffery9 at gmail.com
Sun Apr 30 06:21:51 MST 2006


---------- Forwarded message ----------
From: 陈帆 <jeffery9 at gmail.com>
Date: Apr 30, 2006 10:30 AM
Subject: can modify CHAN_SIP.c to generate a new exten=>
ext,2,dial(tech/peer) ?
To: Asterisk Users Mailing List - Non-Commercial Discussion <
asterisk-users at lists.digium.com>

 Hi, ALL,

Whether can modify CHAN_SIP.c to add one new * int
**ast_add_extension*<http://www.diaip.com/api/pbx_8c.html#a175>
*(const char *context, int replace, const char *extension, int priority,
const char *label, const char *callerid,const char *application, void *data,
void (*datad)(void *), const char *registrar)*  to generate a new exten=>
ext,2,dial(tech/peer)


01610 void register_peer_exten  (  struct sip_peer
*    peer,    int    onoff  )

01613 {
01614    char multi[256];
01615    char *stringp, *ext;
01616    if (!ast_strlen_zero(regcontext)) {
01617       ast_copy_string(multi, ast_strlen_zero(peer->regexten) ?
peer->name : peer->regexten, sizeof(multi));
01618       stringp = multi;
01619       while((ext = strsep(&stringp, "&"))) {
01620          if (onoff)ra
01621             ast_add_extension(regcontext, 1, ext, 1, NULL, NULL,
"Noop", strdup(peer->name), free, channeltype);

                      ast_add_extension(regcontext, 1, ext, 2, NULL, NULL,
"Dial", strdup(peer->name), free, channeltype);      /*how to set the
*data,,oom.... add the exten => ext, 2, dial(channeltype/peername) */



01622          else
01623             ast_context_remove_extension(regcontext, ext, 1, NULL);
01624       }
01625    }
01626 }




--
Jeffery

iaxtel Num: 1-700-576-1311
fwdnet Num: 728150



--
Jeffery

iaxtel Num: 1-700-576-1311
fwdnet Num: 728150
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20060430/eee4d42a/attachment.htm


More information about the asterisk-users mailing list