diff options
author | crichter <crichter@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-01-11 13:27:52 +0000 |
---|---|---|
committer | crichter <crichter@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-01-11 13:27:52 +0000 |
commit | 491cf508dd486a2b1121ae8e0a2800ef092035db (patch) | |
tree | 002ea638049ea68b231160899a1ba75e6b204db5 /channels/chan_misdn.c | |
parent | 42d84412db13373edb94eeef8f757d804233fbda (diff) |
* more additions to make the RESTART message work
* added fix for misdn_call to allow SETUPs with empty
extensions, replaced the strtok_r functions with strsep for that
(inspired by Sandro Cappellazzo, thanks)
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.2@50495 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels/chan_misdn.c')
-rw-r--r-- | channels/chan_misdn.c | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/channels/chan_misdn.c b/channels/chan_misdn.c index 49531126a..f5499fd9d 100644 --- a/channels/chan_misdn.c +++ b/channels/chan_misdn.c @@ -1623,23 +1623,21 @@ static int misdn_call(struct ast_channel *ast, char *dest, int timeout) int r; struct chan_list *ch=MISDN_ASTERISK_TECH_PVT(ast); struct misdn_bchannel *newbc; - char *opts=NULL, *ext,*tokb; + char *opts=NULL, *ext; char dest_cp[256]; { strncpy(dest_cp,dest,sizeof(dest_cp)-1); dest_cp[sizeof(dest_cp)]=0; - - ext=strtok_r(dest_cp,"/",&tokb); - + + ext=dest_cp; + strsep(&ext,"/"); if (ext) { - ext=strtok_r(NULL,"/",&tokb); - if (ext) { - opts=strtok_r(NULL,"/",&tokb); - } else { - chan_misdn_log(0,0,"misdn_call: No Extension given!\n"); - return -1; - } + opts=ext; + strsep(&opts,"/"); + } else { + ast_log(LOG_WARNING, "Malformed dialstring\n"); + return -1; } } |