diff options
author | markster <markster@f38db490-d61c-443f-a65b-d21fe96a405b> | 2004-06-25 03:59:07 +0000 |
---|---|---|
committer | markster <markster@f38db490-d61c-443f-a65b-d21fe96a405b> | 2004-06-25 03:59:07 +0000 |
commit | 96c27903b13f3789f60fb8299eace827ca4ff3d6 (patch) | |
tree | 10ec669a31a880a3a24a8a842bec640b09caeac5 /apps/app_dial.c | |
parent | 461824ef0bcd514c3678e297c76010cd3e316f1d (diff) |
Add outgoing OSP support (SIP only at this point)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@3296 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps/app_dial.c')
-rwxr-xr-x | apps/app_dial.c | 42 |
1 files changed, 16 insertions, 26 deletions
diff --git a/apps/app_dial.c b/apps/app_dial.c index 3a963f9f3..4b05ad478 100755 --- a/apps/app_dial.c +++ b/apps/app_dial.c @@ -362,6 +362,7 @@ static struct ast_channel *wait_for_answer(struct ast_channel *in, struct localu if (!f || ((f->frametype == AST_FRAME_CONTROL) && (f->subclass == AST_CONTROL_HANGUP))) { /* Got hung up */ *to=-1; + strcpy(status, "CANCEL"); return NULL; } if (f && (f->frametype == AST_FRAME_DTMF) && *allowdisconnect && @@ -722,36 +723,21 @@ static int dial_exec(struct ast_channel *chan, void *data) /* If creating a SIP channel, look for a variable called */ /* VXML_URL in the calling channel and copy it to the */ /* new channel. */ - if (strcasecmp(tech,"SIP")==0) - { - headp=&chan->varshead; - AST_LIST_TRAVERSE(headp,current,entries) { - if (strcasecmp(ast_var_name(current),"VXML_URL")==0) - { - newvar=ast_var_assign(ast_var_name(current),ast_var_value(current)); - newheadp=&tmp->chan->varshead; - AST_LIST_INSERT_HEAD(newheadp,newvar,entries); - break; - } - } - } + /* Check for ALERT_INFO in the SetVar list. This is for */ /* SIP distinctive ring as per the RFC. For Cisco 7960s, */ /* SetVar(ALERT_INFO=<x>) where x is an integer value 1-5. */ /* However, the RFC says it should be a URL. -km- */ - - if (strcasecmp(tech,"SIP")==0) - { - headp=&chan->varshead; - AST_LIST_TRAVERSE(headp,current,entries) { - /* Search for ALERT_INFO */ - if (strcasecmp(ast_var_name(current),"ALERT_INFO")==0) - { - newvar=ast_var_assign(ast_var_name(current),ast_var_value(current)); - newheadp=&tmp->chan->varshead; - AST_LIST_INSERT_HEAD(newheadp,newvar,entries); - break; - } + headp=&chan->varshead; + AST_LIST_TRAVERSE(headp,current,entries) { + if (!strcasecmp(ast_var_name(current),"VXML_URL") || + !strcasecmp(ast_var_name(current), "ALERT_INFO") || + !strcasecmp(ast_var_name(current), "OSPTOKEN") || + !strcasecmp(ast_var_name(current), "OSPHANDLE")) + { + newvar=ast_var_assign(ast_var_name(current),ast_var_value(current)); + newheadp=&tmp->chan->varshead; + AST_LIST_INSERT_HEAD(newheadp,newvar,entries); } } @@ -850,6 +836,10 @@ static int dial_exec(struct ast_channel *chan, void *data) goto out; } if (peer) { +#ifdef OSP_SUPPORT + /* Once call is answered, ditch the OSP Handle */ + pbx_builtin_setvar_helper(chan, "OSPHANDLE", ""); +#endif strcpy(status, "ANSWER"); /* Ah ha! Someone answered within the desired timeframe. Of course after this we will always return with -1 so that it is hung up properly after the |